diff --git a/src/project/wuxi/AppPhotoReport/PhotoForm.vue b/src/project/wuxi/AppPhotoReport/PhotoForm.vue index 24359ff..c8942de 100644 --- a/src/project/wuxi/AppPhotoReport/PhotoForm.vue +++ b/src/project/wuxi/AppPhotoReport/PhotoForm.vue @@ -127,15 +127,13 @@ export default { }, onLoad() { - this.autoLogin() - }, - onShow() { - this.$nextTick(() => { - this.token && this.getUserInfo() - this.getDict() - this.form.phone = this.user.phone - this.form.name = this.user.realName || '' - }) + if (!this.token) { + this.autoLogin().then(() => { + this.getUser() + }) + } else { + this.getUser() + } }, methods: { @@ -230,6 +228,15 @@ export default { }, handleSelectGrid(v) { this.form.girdName = v.girdName + }, + getUser() { + this.getUserInfo().then(() => { + this.getDict() + this.form.phone = this.user.phone + this.form.name = this.user.realName || '' + }).catch(() => { + this.$refs.login.show() + }) } } }