mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp.git
synced 2025-12-17 16:05:53 +08:00
优化小程序登录跳转部分代码.新增全局条件编译跳转方法
This commit is contained in:
@@ -117,6 +117,27 @@ export function getPages(val) {
|
||||
return val ? currentPage : url;
|
||||
}
|
||||
|
||||
/**
|
||||
* 跳转到登录页面
|
||||
*/
|
||||
export function navigateToLogin(type = "navigateTo") {
|
||||
/**
|
||||
* 此处进行条件编译判断
|
||||
* 微信小程序跳转到微信小程序登录页面
|
||||
* H5/App跳转到普通登录页面
|
||||
*/
|
||||
// #ifdef MP-WEIXIN
|
||||
uni[type]({
|
||||
url: "/pages/passport/wechatMPLogin",
|
||||
});
|
||||
// #endif
|
||||
// #ifndef MP-WEIXIN
|
||||
uni[type]({
|
||||
url: "/pages/passport/login",
|
||||
});
|
||||
// #endif
|
||||
}
|
||||
|
||||
/**
|
||||
* 服务状态列表
|
||||
*/
|
||||
|
||||
@@ -77,9 +77,17 @@ function cleanStorage() {
|
||||
storage.setUuid("");
|
||||
storage.setUserInfo({});
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
uni.navigateTo({
|
||||
url: "/pages/passport/wechatMPLogin",
|
||||
});
|
||||
// #endif
|
||||
|
||||
// #ifndef MP-WEIXIN
|
||||
uni.navigateTo({
|
||||
url: "/pages/passport/login",
|
||||
});
|
||||
// #endif
|
||||
}
|
||||
|
||||
let http = new Request();
|
||||
|
||||
Reference in New Issue
Block a user