From e96e22f2b083d6b658f11e19c52f74ce39cbe575 Mon Sep 17 00:00:00 2001 From: WindowBird <13870814+windows-bird@user.noreply.gitee.com> Date: Sat, 13 Sep 2025 10:10:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=AA=E6=9C=89=E5=9C=A8=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E6=83=85=E5=86=B5=E4=B8=8B=E6=89=8D=E6=9C=89=E9=A6=96=E6=AC=A1?= =?UTF-8?q?=E6=8F=90=E9=86=92=E5=8F=96=E5=AE=9E=E5=90=8D,=20=E5=AE=9E?= =?UTF-8?q?=E5=90=8D=E8=AE=A4=E8=AF=81=E5=88=B7=E6=96=B0=E5=AE=9E=E5=90=8D?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E7=9A=84=E6=8F=90=E7=A4=BA=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/index/index.vue | 17 ++++++++++++++++- .../realNameAuthentication.vue | 12 ++++++------ 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/pages/index/index.vue b/pages/index/index.vue index 5aae8e6..abf149c 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -70,6 +70,8 @@ export default { }, data() { return { + shihasExecuted: uni.getStorageSync('hasExecutedGoToRealName') || false, + // 基础配置 isRealName: false, indicatorDots: true, @@ -107,16 +109,29 @@ export default { this.fetchAnnouncement() this.fetchBannerList() this.fetchDeviceList() - this.goToRealName() }, onShow() { this.fetchAnnouncement() this.fetchBannerList() this.fetchDeviceList() + this.onceTipRealName() }, methods: { + async onceTipRealName() { + console.log('onceTipRealName-hasExecuted:', this.hasExecuted) + const storageInfo = uni.getStorageInfoSync() + console.log('当前存储Keys:', storageInfo.keys) + let token = uni.getStorageSync('token') + console.log('onceTipRealName-token:', token) + + if (token && !this.hasExecuted) { + await this.goToRealName() + this.hasExecuted = true + uni.setStorageSync('hasExecutedGoToRealName', true) + } + }, async goToRealName() { const res = await getIsRealName() if (!res.data) { diff --git a/pages/realNameAuthentication/realNameAuthentication.vue b/pages/realNameAuthentication/realNameAuthentication.vue index f07f32c..8721fda 100644 --- a/pages/realNameAuthentication/realNameAuthentication.vue +++ b/pages/realNameAuthentication/realNameAuthentication.vue @@ -114,12 +114,12 @@ export default { // 统一处理失败 handleRefreshFail(message) { - // uni.showModal({ - // title: '提示', - // content: message, - // showCancel: false, - // // complete: () => uni.navigateBack(), - // }) + uni.showModal({ + title: '提示', + content: message, + showCancel: false, + // // complete: () => uni.navigateBack(), + }) }, // 点击进行实名认证