|
@@ -38,20 +38,11 @@ module.exports = (vm) => {
|
|
|
let backUrl = pages[pages.length - 1].route;
|
|
|
let options =uni.$u.queryParams( pages[pages.length - 1].options);
|
|
|
let fullBackUrl = backUrl+options;
|
|
|
- const loginUrl = 'login'
|
|
|
- if (backUrl.indexOf(loginUrl) > 0) {
|
|
|
- uni.removeStorage({
|
|
|
- key: 'backUrl',
|
|
|
- success: function (res) {
|
|
|
- // console.log('success');
|
|
|
- }
|
|
|
- });
|
|
|
- } else {
|
|
|
- // uni.showToast({
|
|
|
- // title: res.msg + "即将跳转到登录页",
|
|
|
- // icon: "none",
|
|
|
- // duration: 2000
|
|
|
- // });
|
|
|
+
|
|
|
+ const backArr = ['productdetails'];
|
|
|
+ const hasBackArr = backArr.some(backPage => backUrl.includes(backPage));
|
|
|
+ if(hasBackArr){
|
|
|
+ console.log('包含');
|
|
|
uni.setStorage({
|
|
|
key: 'backUrl',
|
|
|
data: fullBackUrl,
|
|
@@ -59,10 +50,43 @@ module.exports = (vm) => {
|
|
|
// console.log('setStorage success');
|
|
|
}
|
|
|
});
|
|
|
- setTimeout(() => {
|
|
|
- uni.$u.route('/pages/login/login');
|
|
|
- }, 1000)
|
|
|
+ }else{
|
|
|
+ console.log('不包含');
|
|
|
+ uni.removeStorage({
|
|
|
+ key: 'backUrl',
|
|
|
+ success: function (res) {
|
|
|
+ // console.log('success');
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
+ setTimeout(() => {
|
|
|
+ uni.$u.route('/pages/login/login');
|
|
|
+ }, 1000)
|
|
|
+ // const loginUrl = 'login'
|
|
|
+ // if (backUrl.indexOf(loginUrl) > 0) {
|
|
|
+ // uni.removeStorage({
|
|
|
+ // key: 'backUrl',
|
|
|
+ // success: function (res) {
|
|
|
+ // // console.log('success');
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // } else {
|
|
|
+ // // uni.showToast({
|
|
|
+ // // title: res.msg + "即将跳转到登录页",
|
|
|
+ // // icon: "none",
|
|
|
+ // // duration: 2000
|
|
|
+ // // });
|
|
|
+ // uni.setStorage({
|
|
|
+ // key: 'backUrl',
|
|
|
+ // data: fullBackUrl,
|
|
|
+ // success: function () {
|
|
|
+ // // console.log('setStorage success');
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // setTimeout(() => {
|
|
|
+ // uni.$u.route('/pages/login/login');
|
|
|
+ // }, 1000)
|
|
|
+ // }
|
|
|
}
|
|
|
}
|
|
|
|