mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp.git
synced 2025-12-18 00:15:54 +08:00
优化小程序登录跳转部分代码.新增全局条件编译跳转方法
This commit is contained in:
@@ -81,6 +81,7 @@ export default {
|
||||
* 进入页面检测当前账户是否登录
|
||||
*/
|
||||
onShow() {
|
||||
let that = this
|
||||
if (this.$options.filters.isLogin("auth")) {
|
||||
this.getAddressList();
|
||||
} else {
|
||||
@@ -90,9 +91,7 @@ export default {
|
||||
confirmColor: this.$lightColor,
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
uni.navigateTo({
|
||||
url: "/pages/passport/login",
|
||||
});
|
||||
that.$options.filters.navigateToLogin();
|
||||
} else if (res.cancel) {
|
||||
uni.navigateBack();
|
||||
}
|
||||
|
||||
@@ -36,9 +36,8 @@ export default {
|
||||
duration: 3000,
|
||||
title: "请先登录!",
|
||||
});
|
||||
uni.redirectTo({
|
||||
url: "/pages/passport/login",
|
||||
});
|
||||
|
||||
this.$options.filters.navigateToLogin("redirectTo");
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
@@ -59,9 +59,7 @@ export default {
|
||||
storage.setAccessToken("");
|
||||
storage.setRefreshToken("");
|
||||
storage.setUserInfo({});
|
||||
uni.redirectTo({
|
||||
url: "/pages/passport/login",
|
||||
});
|
||||
this.$options.filters.navigateToLogin("redirectTo");
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user