diff --git a/uniapp/src/pages/login/login.vue b/uniapp/src/pages/login/login.vue index f7bab046..94ed0010 100644 --- a/uniapp/src/pages/login/login.vue +++ b/uniapp/src/pages/login/login.vue @@ -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({