From 951ea816ab930741e7c343b91d5277dced14c4f8 Mon Sep 17 00:00:00 2001 From: chenkainan Date: Wed, 25 Sep 2024 09:46:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=B0=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/map/map.vue | 16 ++++++++++++---- pages/user/user.vue | 2 +- subPackages/h5Web/h5Web.vue | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/pages/map/map.vue b/pages/map/map.vue index 2ff6841..466f15e 100644 --- a/pages/map/map.vue +++ b/pages/map/map.vue @@ -1,6 +1,6 @@ @@ -8,11 +8,19 @@ export default { data() { return { - + src: '' } }, - onReady() { - + onShow() { + // 必须登录 + let userInfo = (uni.getStorageSync('userInfo') && JSON.parse(uni.getStorageSync('userInfo'))) || this.$store.state.user.userInfo || {} + if(userInfo.token) { + this.src = 'https://yandumap.sz-trip.com?token=' + userInfo.token + }else { + uni.navigateTo({ + url: '/pages/login/login' + }) + } }, methods: { diff --git a/pages/user/user.vue b/pages/user/user.vue index 6c0ff40..9637cc5 100644 --- a/pages/user/user.vue +++ b/pages/user/user.vue @@ -137,7 +137,7 @@ } }, onShow() { - this.userInfo = JSON.parse(uni.getStorageSync('userInfo')) || this.$store.state.user.userInfo || {} + this.userInfo = (uni.getStorageSync('userInfo') && JSON.parse(uni.getStorageSync('userInfo'))) || this.$store.state.user.userInfo || {} console.log(this.userInfo) // this.dfkList = [] // this.nowDateTime = parseInt(new Date().getTime() / 1000) diff --git a/subPackages/h5Web/h5Web.vue b/subPackages/h5Web/h5Web.vue index ea73887..c4854ab 100644 --- a/subPackages/h5Web/h5Web.vue +++ b/subPackages/h5Web/h5Web.vue @@ -14,7 +14,7 @@ const oTherMiniprogramIsBack = uni.getStorageSync('oTherMiniprogramIsBack') if(oTherMiniprogramIsBack) { uni.showModal({ - title: '是否返回...', + title: '是否返回盐都小程序', success: () => { uni.removeStorageSync('oTherMiniprogramIsBack') uni.navigateBack();