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(), + }) }, // 点击进行实名认证