xy 1 year ago
parent 58bb926101
commit 9699e902f6

@ -281,6 +281,7 @@ export default {
await this.$store.dispatch('user/logout') await this.$store.dispatch('user/logout')
await this.$store.commit('permission/SET_ROUTES', []) await this.$store.commit('permission/SET_ROUTES', [])
await this.$store.commit('permission/RESET_ADD_ROUTES') await this.$store.commit('permission/RESET_ADD_ROUTES')
await this.$store.commit('app/SET_LAYOUT', {})
this.$router.push(`/login?redirect=${this.$route.fullPath}`) this.$router.push(`/login?redirect=${this.$route.fullPath}`)
} }
} }

@ -45,7 +45,7 @@ const files = require.context(
const cpns = files.keys().map((key) => { const cpns = files.keys().map((key) => {
return files(key).default || files(key) return files(key).default || files(key)
}) })
const layout = cpns.map((item) => { const layout = cpns.filter(item => !item.layout.disabled).map((item) => {
return { return {
...item.layout, ...item.layout,
component: item component: item

@ -68,7 +68,8 @@ export default {
w: 8, w: 8,
h: 5, h: 5,
i: 'AddressBook', i: 'AddressBook',
name: '通讯录' name: '通讯录',
disabled: true
}, },
data() { data() {
return { return {

@ -22,12 +22,14 @@
}" }"
:limit="1" :limit="1"
:action="action" :action="action"
:show-file-list="false" :show-file-list="true"
:file-list="imgUrl ? [{url: imgUrl}] : []"
:on-success="uploadSuccess" :on-success="uploadSuccess"
:on-remove="uploadRemove"
:before-upload="beforeAvatarUpload" :before-upload="beforeAvatarUpload"
> >
<img v-if="imgUrl" :src="imgUrl" alt="" style="width: 146px;height: 146px;object-fit: contain;display: block;border-radius: 6px;"> <!-- <img v-if="imgUrl" :src="imgUrl" alt="" style="width: 146px;height: 146px;object-fit: contain;display: block;border-radius: 6px;">-->
<i v-else class="el-icon-plus" /> <i class="el-icon-plus" />
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
@ -98,17 +100,24 @@ export default {
} }
}, },
watch: { watch: {
user(newVal) { user: {
handler: function(newVal) {
if (newVal) { if (newVal) {
for (const key in this.form) { for (const key in this.form) {
this.form[key] = newVal[key] 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: { methods: {
getToken, getToken,
uploadRemove(file, fileList) {
this.form.sign_id = ''
this.imgUrl = ''
},
uploadSuccess(res, file) { uploadSuccess(res, file) {
if (!res.code) { if (!res.code) {
this.imgUrl = res.data.url this.imgUrl = res.data.url

@ -88,7 +88,7 @@ const files = require.context(
const cpns = files.keys().map((key) => { const cpns = files.keys().map((key) => {
return files(key).default || files(key) return files(key).default || files(key)
}) })
const layout = cpns.map((item) => { const layout = cpns.filter(item => !item.layout.disabled).map((item) => {
return { return {
...item.layout, ...item.layout,
component: item component: item

Loading…
Cancel
Save