From ee02cc8f733b67d5f1b00a4d68e46308fa32fd80 Mon Sep 17 00:00:00 2001 From: liuye Date: Thu, 18 May 2023 11:57:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E4=B8=8A=E6=8A=A5=E7=99=BB?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/project/wuxi/AppPhotoReport/PhotoForm.vue | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) 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() + }) } } }