refactor(member pages): unify onShow login redirect logic
1. extract common onShow login check to dedicated method redirectTologinOnShowLifecycle 2. add fallback callback for login failure to navigate back on wechat mini program 3. update all page login redirect calls to use the new unified method 4. add debug logs for redirect and auth flow tracing
This commit is contained in:
@@ -84,7 +84,7 @@ export default {
|
||||
},
|
||||
onShow() {
|
||||
if (!this.storeToken) {
|
||||
this.redirectTologin('/pages_tool/member/account');
|
||||
this.redirectTologinOnShowLifecycle('/pages_tool/member/account');
|
||||
return;
|
||||
}
|
||||
this.getTransferType();
|
||||
|
||||
@@ -129,7 +129,7 @@ export default {
|
||||
},
|
||||
onShow() {
|
||||
if (!this.storeToken) {
|
||||
this.redirectTologin('/pages_tool/member/address');
|
||||
this.redirectTologinOnShowLifecycle('/pages_tool/member/address');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ export default {
|
||||
},
|
||||
onShow() {
|
||||
if (!this.storeToken) {
|
||||
this.redirectTologin('/pages_tool/member/balance');
|
||||
this.redirectTologinOnShowLifecycle('/pages_tool/member/balance');
|
||||
return;
|
||||
}
|
||||
this.getWithdrawConfig();
|
||||
|
||||
@@ -95,7 +95,7 @@ export default {
|
||||
},
|
||||
onShow() {
|
||||
if (!this.storeToken) {
|
||||
this.redirectTologin('/pages_tool/member/balance_detail');
|
||||
this.redirectTologinOnShowLifecycle('/pages_tool/member/balance_detail');
|
||||
return;
|
||||
}
|
||||
},
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
},
|
||||
onShow() {
|
||||
if (!this.storeToken) {
|
||||
this.redirectTologin('/pages_tool/member/bind_mobile');
|
||||
this.redirectTologinOnShowLifecycle('/pages_tool/member/bind_mobile');
|
||||
return;
|
||||
}
|
||||
},
|
||||
|
||||
@@ -140,7 +140,7 @@ export default {
|
||||
},
|
||||
onShow() {
|
||||
if (!this.storeToken) {
|
||||
this.redirectTologin('/pages_tool/member/card');
|
||||
this.redirectTologinOnShowLifecycle('/pages_tool/member/card');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -296,7 +296,7 @@ export default {
|
||||
},
|
||||
onShow() {
|
||||
if (!this.storeToken) {
|
||||
this.redirectTologin('/pages_tool/member/card_buy');
|
||||
this.redirectTologinOnShowLifecycle('/pages_tool/member/card_buy');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ export default {
|
||||
onLoad() {},
|
||||
onShow() {
|
||||
if (!this.storeToken) {
|
||||
this.redirectTologin('/pages_tool/member/card_log');
|
||||
this.redirectTologinOnShowLifecycle('/pages_tool/member/card_log');
|
||||
return;
|
||||
}
|
||||
this.loadStat();
|
||||
|
||||
@@ -104,7 +104,7 @@ export default {
|
||||
},
|
||||
onShow() {
|
||||
if (!this.storeToken) {
|
||||
this.redirectTologin('/pages_tool/member/coupon');
|
||||
this.redirectTologinOnShowLifecycle('/pages_tool/member/coupon');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -248,7 +248,7 @@
|
||||
onLoad(option) {},
|
||||
onShow() {
|
||||
if (!this.storeToken) {
|
||||
this.redirectTologin('/pages_tool/member/invite_friends');
|
||||
this.redirectTologinOnShowLifecycle('/pages_tool/member/invite_friends');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -219,7 +219,7 @@
|
||||
},
|
||||
onShow() {
|
||||
if (!this.storeToken) {
|
||||
this.redirectTologin('/pages_tool/member/level');
|
||||
this.redirectTologinOnShowLifecycle('/pages_tool/member/level');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ export default {
|
||||
},
|
||||
onShow() {
|
||||
if (!this.storeToken) {
|
||||
this.redirectTologin('/pages_tool/member/point');
|
||||
this.redirectTologinOnShowLifecycle('/pages_tool/member/point');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ export default {
|
||||
},
|
||||
onShow() {
|
||||
if (!this.storeToken) {
|
||||
this.redirectTologin('/pages_tool/member/info');
|
||||
this.redirectTologinOnShowLifecycle('/pages_tool/member/info');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ export default {
|
||||
},
|
||||
onShow() {
|
||||
if (!this.storeToken) {
|
||||
this.redirectTologin('/pages_tool/member/signin');
|
||||
this.redirectTologinOnShowLifecycle('/pages_tool/member/signin');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user