|
@@ -81,14 +81,6 @@ const handleToDetail = (type) => {
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
-const handleRemove = () => {
|
|
|
|
- uni.removeStorageSync('wxLoginCode')
|
|
|
|
- setTimeout(() => {
|
|
|
|
- uni.switchTab({
|
|
|
|
- url: '/pages/index/my'
|
|
|
|
- })
|
|
|
|
- }, 2000)
|
|
|
|
-}
|
|
|
|
|
|
|
|
// 已登录的授权给网页
|
|
// 已登录的授权给网页
|
|
const handleTokenLogin = async () => {
|
|
const handleTokenLogin = async () => {
|
|
@@ -110,15 +102,23 @@ const handleTokenLogin = async () => {
|
|
}
|
|
}
|
|
try {
|
|
try {
|
|
await weixinLoginAuthorize({ uuid: uni.getStorageSync('wxLoginCode') })
|
|
await weixinLoginAuthorize({ uuid: uni.getStorageSync('wxLoginCode') })
|
|
|
|
+
|
|
uni.showToast({ title: '授权网页登录成功', duration: 2000, icon: 'none' })
|
|
uni.showToast({ title: '授权网页登录成功', duration: 2000, icon: 'none' })
|
|
- handleRemove()
|
|
|
|
|
|
+ uni.setStorageSync('necessaryInfoReady', necessaryInfoReady ? 'ready' : 'student')
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ uni.switchTab({
|
|
|
|
+ url: '/pages/index/my'
|
|
|
|
+ })
|
|
|
|
+ }, 2000)
|
|
|
|
+
|
|
} catch (error) {
|
|
} catch (error) {
|
|
console.log(error, '授权接口error')
|
|
console.log(error, '授权接口error')
|
|
- handleRemove()
|
|
|
|
|
|
+ } finally {
|
|
|
|
+ uni.removeStorageSync('wxLoginCode')
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else showAuthModal('necessaryInfo')
|
|
else showAuthModal('necessaryInfo')
|
|
- uni.setStorageSync('necessaryInfoReady', necessaryInfoReady ? 'ready' : 'student')
|
|
|
|
|
|
+ // uni.setStorageSync('necessaryInfoReady', necessaryInfoReady ? 'ready' : 'student')
|
|
}
|
|
}
|
|
|
|
|
|
// 微信登录
|
|
// 微信登录
|