修复h5下登录问题
This commit is contained in:
parent
9e5bd06e37
commit
9595769d46
|
|
@ -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({
|
||||
|
|
|
|||
Loading…
Reference in New Issue