提交 e50dd806 编写于 作者: DCloud_JSON's avatar DCloud_JSON

修复 注册并登录后,没有返回到业务页面的问题

上级 528a1eba
...@@ -20,11 +20,11 @@ export const loginSuccess = (_ : UTSJSONObject) => { ...@@ -20,11 +20,11 @@ export const loginSuccess = (_ : UTSJSONObject) => {
// #endif // #endif
// console.log('uniIdRedirectUrl', uniIdRedirectUrl); // console.log('uniIdRedirectUrl', uniIdRedirectUrl);
uni.redirectTo({ uni.redirectTo({
url: uniIdRedirectUrl, url: uniIdRedirectUrl as string,
fail() { fail() {
console.error("uniIdRouter redirectTo fail"); console.error("uniIdRouter redirectTo fail");
uni.switchTab({ uni.switchTab({
"url": uniIdRedirectUrl "url": uniIdRedirectUrl as string
}) })
}, },
success() { success() {
...@@ -33,6 +33,18 @@ export const loginSuccess = (_ : UTSJSONObject) => { ...@@ -33,6 +33,18 @@ export const loginSuccess = (_ : UTSJSONObject) => {
}) })
} else if (currentPage.route.includes("uni_modules/uni-id-pages-x/pages/login/login") ){ } else if (currentPage.route.includes("uni_modules/uni-id-pages-x/pages/login/login") ){
uni.navigateBack() uni.navigateBack()
} else {
// 需要返回的页面数
const needBackCount = pages.reduce((count, page) => {
if (page.route.includes("uni_modules/uni-id-pages-x/pages")) {
return count + 1
}
return count
}, 0)
// console.log('needBackCount', needBackCount);
uni.navigateBack({
delta: needBackCount
})
} }
}; };
const toastDuration = 1500 const toastDuration = 1500
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册