From efb18515f52f877140cd5e22fc05f44c2d3325cc Mon Sep 17 00:00:00 2001 From: aixianling Date: Wed, 6 Mar 2024 15:11:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E9=99=A4=E5=8D=95=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 25 ++++++++++++++----------- src/components/utils/modules.js | 13 ++++++++----- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/src/App.vue b/src/App.vue index 47615dc..e36568a 100644 --- a/src/App.vue +++ b/src/App.vue @@ -2,17 +2,20 @@ export default { onLaunch() { - if (!wx.getUpdateManager) return - const updateManager = wx.getUpdateManager() - updateManager.onUpdateReady(() => { - this.$dialog.alert({ - title: '更新提示', - content: '新版本已经准备好,点击确认按钮重启应用!' - }).then(() => { - updateManager.applyUpdate() - }).catch(() => { - }) - }) + if (uni.getUpdateManager) { + const updateManager = uni.getUpdateManager() + if (updateManager) { + updateManager.onUpdateReady(() => { + this.$dialog.alert({ + title: '更新提示', + content: '新版本已经准备好,点击确认按钮重启应用!' + }).then(() => { + updateManager.applyUpdate() + }).catch(() => { + }) + }) + } + } }, } diff --git a/src/components/utils/modules.js b/src/components/utils/modules.js index 91fbee3..da36cd0 100644 --- a/src/components/utils/modules.js +++ b/src/components/utils/modules.js @@ -40,7 +40,10 @@ export const user = { reject(res); } }, - fail: () => resolve(dispatch("getCode", ++count)) + fail: err => { + console.error(err) + resolve(dispatch("getCode", ++count)) + } }) }) }, @@ -97,23 +100,23 @@ export const user = { uni.navigateTo({url: modulePath}); } else if (checkType == 4) { if (!token) { - return dispatch('autoLogin', { loginWay: 'qujing' }).then(() => dispatch('authCheck', { checkType, modulePath })); + return dispatch('autoLogin', {loginWay: 'qujing'}).then(() => dispatch('authCheck', {checkType, modulePath})); } if (!userInfo.areaId) { return uni.showModal({ title: '温馨提示', content: '您只有完成信息认证后,才可进行相关操作。', confirmText: '去认证', - success: (res)=> { + success: (res) => { if (res.confirm) { - uni.reLaunch({ url: `/pages/AppMine/userInfo?isFromTabbar=1&path=/pages/AppHome/AppHome` }) + uni.reLaunch({url: `/pages/AppMine/userInfo?isFromTabbar=1&path=/pages/AppHome/AppHome`}) } else if (res.cancel) { // 停留 } } }) } - uni.navigateTo({ url: modulePath }); + uni.navigateTo({url: modulePath}); } } }