diff --git a/src/layout/components/Navbar/index.vue b/src/layout/components/Navbar/index.vue index b483436..29f8cba 100644 --- a/src/layout/components/Navbar/index.vue +++ b/src/layout/components/Navbar/index.vue @@ -281,6 +281,7 @@ export default { await this.$store.dispatch('user/logout') await this.$store.commit('permission/SET_ROUTES', []) await this.$store.commit('permission/RESET_ADD_ROUTES') + await this.$store.commit('app/SET_LAYOUT', {}) this.$router.push(`/login?redirect=${this.$route.fullPath}`) } } diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue index c3ff70b..ce2ca7e 100644 --- a/src/views/dashboard/index.vue +++ b/src/views/dashboard/index.vue @@ -45,7 +45,7 @@ const files = require.context( const cpns = files.keys().map((key) => { return files(key).default || files(key) }) -const layout = cpns.map((item) => { +const layout = cpns.filter(item => !item.layout.disabled).map((item) => { return { ...item.layout, component: item diff --git a/src/views/system/DashboardComponents/AddressBook.vue b/src/views/system/DashboardComponents/AddressBook.vue index 5bb6e6b..88a5e85 100644 --- a/src/views/system/DashboardComponents/AddressBook.vue +++ b/src/views/system/DashboardComponents/AddressBook.vue @@ -68,7 +68,8 @@ export default { w: 8, h: 5, i: 'AddressBook', - name: '通讯录' + name: '通讯录', + disabled: true }, data() { return { diff --git a/src/views/system/components/Account.vue b/src/views/system/components/Account.vue index 261eea1..e565d22 100644 --- a/src/views/system/components/Account.vue +++ b/src/views/system/components/Account.vue @@ -22,12 +22,14 @@ }" :limit="1" :action="action" - :show-file-list="false" + :show-file-list="true" + :file-list="imgUrl ? [{url: imgUrl}] : []" :on-success="uploadSuccess" + :on-remove="uploadRemove" :before-upload="beforeAvatarUpload" > - - + + @@ -98,17 +100,24 @@ export default { } }, watch: { - user(newVal) { - if (newVal) { - for (const key in this.form) { - this.form[key] = newVal[key] + user: { + handler: function(newVal) { + if (newVal) { + for (const key in this.form) { + this.form[key] = newVal[key] + } + this.imgUrl = (newVal.sign_file && typeof newVal.sign_file === 'object') ? newVal.sign_file.url : '' } - this.imgUrl = (newVal.sign_file && typeof newVal.sign_file === 'object') ? newVal.sign_file.url : '' - } + }, + immediate: true } }, methods: { getToken, + uploadRemove(file, fileList) { + this.form.sign_id = '' + this.imgUrl = '' + }, uploadSuccess(res, file) { if (!res.code) { this.imgUrl = res.data.url diff --git a/src/views/system/dashboard.vue b/src/views/system/dashboard.vue index f14801c..bd91491 100644 --- a/src/views/system/dashboard.vue +++ b/src/views/system/dashboard.vue @@ -88,7 +88,7 @@ const files = require.context( const cpns = files.keys().map((key) => { return files(key).default || files(key) }) -const layout = cpns.map((item) => { +const layout = cpns.filter(item => !item.layout.disabled).map((item) => { return { ...item.layout, component: item