修复h5下登录问题

This commit is contained in:
Jason 2023-01-17 15:46:07 +08:00
parent 9e5bd06e37
commit 9595769d46
1 changed files with 4 additions and 4 deletions

View File

@ -167,7 +167,6 @@ import { useAppStore } from '@/stores/app'
import { useUserStore } from '@/stores/user'
import cache from '@/utils/cache'
import { isWeixinClient } from '@/utils/client'
import { currentPage } from '@/utils/util'
// #ifdef H5
import wechatOa from '@/utils/wechat'
// #endif
@ -285,17 +284,18 @@ const loginHandle = async (data: any) => {
await userStore.getUser()
uni.$u.toast('登录成功')
uni.hideLoading()
if (getCurrentPages().length > 1) {
const pages = getCurrentPages()
if (pages.length > 1) {
const prevPage = pages.at(-2)
uni.navigateBack({
success: () => {
// @ts-ignore
const { onLoad, options } = currentPage()
const { onLoad, options } = prevPage
//
onLoad && onLoad(options)
}
})
} else if (cache.get(BACK_URL)) {
console.log(BACK_URL, cache.get(BACK_URL))
uni.redirectTo({ url: cache.get(BACK_URL) })
} else {
uni.reLaunch({