chore: 使用常量来处理登录的路由页面路径

This commit is contained in:
2026-01-07 15:51:24 +08:00
parent 6f01b3c1c6
commit 2f230d3b2c
30 changed files with 33 additions and 31 deletions

View File

@@ -12,6 +12,7 @@ export const INDEX_PAGE_URL = '/pages/index/index';
export const CATEGORY_PAGE_URL = '/pages_goods/category'; export const CATEGORY_PAGE_URL = '/pages_goods/category';
export const CONTACT_PAGE_URL = '/pages_tool/contact/contact'; export const CONTACT_PAGE_URL = '/pages_tool/contact/contact';
export const MEMBER_PAGE_URL = '/pages_tool/member/index'; export const MEMBER_PAGE_URL = '/pages_tool/member/index';
export const LOGIN_PAGE_URL = '/pages_tool/login/login';
// 当前最新的tabBar.list (参见pages.json 中的tabBar.list 配置) // 当前最新的tabBar.list (参见pages.json 中的tabBar.list 配置)
export const systemTabBarList = [ export const systemTabBarList = [
@@ -117,6 +118,7 @@ export default {
CATEGORY_PAGE_URL, CATEGORY_PAGE_URL,
CONTACT_PAGE_URL, CONTACT_PAGE_URL,
INDEX_PAGE_URL, INDEX_PAGE_URL,
LOGIN_PAGE_URL,
/** /**
* 页面跳转 * 页面跳转

View File

@@ -75,7 +75,7 @@ export default {
this.currentRoute = '/' + currentPage.route; this.currentRoute = '/' + currentPage.route;
if (!this.storeToken) { if (!this.storeToken) {
this.$util.redirectTo( this.$util.redirectTo(
'/pages_tool/login/login', this.$util.LOGIN_PAGE_URL,
{ {
back: this.currentRoute back: this.currentRoute
}, },

View File

@@ -286,10 +286,10 @@ export default {
// 跳转去登录页 // 跳转去登录页
toLogin(mode = 'navigateTo') { toLogin(mode = 'navigateTo') {
if (this.url) this.$util.redirectTo('/pages_tool/login/login', { if (this.url) this.$util.redirectTo(this.$util.LOGIN_PAGE_URL, {
back: encodeURIComponent(this.url) back: encodeURIComponent(this.url)
}, mode); }, mode);
else this.$util.redirectTo('/pages_tool/login/login', {}, mode); else this.$util.redirectTo(this.$util.LOGIN_PAGE_URL, {}, mode);
}, },
// 取消完善信息 // 取消完善信息

View File

@@ -669,7 +669,7 @@ export default {
this.getEvaluateConfig(); this.getEvaluateConfig();
this.getOrderData(); this.getOrderData();
} else { } else {
this.$util.redirectTo('/pages_tool/login/login', { this.$util.redirectTo(this.$util.LOGIN_PAGE_URL, {
back: '/pages_order/detail?order_id=' + this.orderId + '&merchant_trade_no=' + this.merchantTradeNo back: '/pages_order/detail?order_id=' + this.orderId + '&merchant_trade_no=' + this.merchantTradeNo
}); });
} }

View File

@@ -161,7 +161,7 @@ export default {
if (this.storeToken) { if (this.storeToken) {
this.getOrderData(); this.getOrderData();
} else { } else {
this.$util.redirectTo('/pages_tool/login/login', { this.$util.redirectTo(this.$util.LOGIN_PAGE_URL, {
back: '/pages_order/detail_point?order_id=' + this.orderId back: '/pages_order/detail_point?order_id=' + this.orderId
}); });
} }

View File

@@ -213,7 +213,7 @@
this.applyStatus(); this.applyStatus();
this.getSourceMemberInfo(); this.getSourceMemberInfo();
} else { } else {
this.$util.redirectTo('/pages_tool/login/login', { this.$util.redirectTo(this.$util.LOGIN_PAGE_URL, {
back: '/pages_promotion/fenxiao/apply' back: '/pages_promotion/fenxiao/apply'
}, 'redirectTo'); }, 'redirectTo');
} }

View File

@@ -224,7 +224,7 @@
this.getFenxiaoInfo(); this.getFenxiaoInfo();
this.getBasicsConfig(); this.getBasicsConfig();
} else { } else {
this.$util.redirectTo('/pages_tool/login/login', { this.$util.redirectTo(this.$util.LOGIN_PAGE_URL, {
back: '/pages_promotion/fenxiao/level' back: '/pages_promotion/fenxiao/level'
}); });
} }

View File

@@ -40,7 +40,7 @@ export default {
if (!this.storeToken) { if (!this.storeToken) {
this.$util.redirectTo( this.$util.redirectTo(
'/pages_tool/login/login', { this.$util.LOGIN_PAGE_URL, {
back: '/pages_promotion/fenxiao/goods_list' back: '/pages_promotion/fenxiao/goods_list'
}, },
'redirectTo' 'redirectTo'

View File

@@ -90,7 +90,7 @@
this.getBankAccountInfo(); this.getBankAccountInfo();
this.getWithdrawInfo(); this.getWithdrawInfo();
} else { } else {
this.$util.redirectTo('/pages_tool/login/login', { this.$util.redirectTo(this.$util.LOGIN_PAGE_URL, {
back: '/pages_promotion/fenxiao/withdraw_apply' back: '/pages_promotion/fenxiao/withdraw_apply'
}); });
} }

View File

@@ -67,7 +67,7 @@ export default {
if (this.storeToken) { if (this.storeToken) {
this.getDetail(); this.getDetail();
} else { } else {
this.$util.redirectTo('/pages_tool/login/login', { this.$util.redirectTo(this.$util.LOGIN_PAGE_URL, {
back: '/pages_promotion/fenxiao/withdraw_list' back: '/pages_promotion/fenxiao/withdraw_list'
}, 'redirectTo'); }, 'redirectTo');
} }

View File

@@ -547,7 +547,7 @@ export default {
} }
// 判断登录 // 判断登录
if (!this.storeToken) { if (!this.storeToken) {
this.$util.redirectTo('/pages_tool/login/login'); this.$util.redirectTo(this.$util.LOGIN_PAGE_URL);
} else { } else {
this.getOrderPaymentData(); this.getOrderPaymentData();
} }

View File

@@ -128,7 +128,7 @@ export default {
if (this.stepShow > 0) { if (this.stepShow > 0) {
this.stepShow -= 1; this.stepShow -= 1;
} else { } else {
this.$util.redirectTo('/pages_tool/login/login', '', 'redirectTo'); this.$util.redirectTo(this.$util.LOGIN_PAGE_URL, '', 'redirectTo');
} }
}, },
// 下一步 // 下一步
@@ -318,7 +318,7 @@ export default {
uni.removeStorage({ uni.removeStorage({
key: 'forgot_password_token' key: 'forgot_password_token'
}); });
this.$util.redirectTo('/pages_tool/login/login', {}, 'redirectTo'); this.$util.redirectTo(this.$util.LOGIN_PAGE_URL, {}, 'redirectTo');
}, 1000); }, 1000);
} else { } else {
this.stepShow -= 1; this.stepShow -= 1;

View File

@@ -78,7 +78,7 @@
this.getWithdrawInfo(); this.getWithdrawInfo();
this.getBankAccountInfo(); this.getBankAccountInfo();
} else { } else {
this.$util.redirectTo('/pages_tool/login/login', { this.$util.redirectTo(this.$util.LOGIN_PAGE_URL, {
back: '/pages_tool/member/apply_withdrawal' back: '/pages_tool/member/apply_withdrawal'
}); });
} }

View File

@@ -92,7 +92,7 @@ export default {
// 判断登录 // 判断登录
if (!this.storeToken) { if (!this.storeToken) {
this.$util.redirectTo('/pages_tool/login/login'); this.$util.redirectTo(this.$util.LOGIN_PAGE_URL);
} else { } else {
this.getAccountInfo(); this.getAccountInfo();
} }

View File

@@ -31,7 +31,7 @@ export default {
if (option.back) this.back = option.back; if (option.back) this.back = option.back;
// 判断登录 // 判断登录
if (!this.storeToken) { if (!this.storeToken) {
this.$util.redirectTo('/pages_tool/login/login'); this.$util.redirectTo(this.$util.LOGIN_PAGE_URL);
} else { } else {
this.getCancelAgreement(); this.getCancelAgreement();
} }

View File

@@ -26,7 +26,7 @@ export default {
// 判断登录 // 判断登录
if (!this.storeToken) { if (!this.storeToken) {
this.$util.redirectTo('/pages_tool/login/login'); this.$util.redirectTo(this.$util.LOGIN_PAGE_URL);
} else { } else {
this.getStatus(); this.getStatus();
} }

View File

@@ -46,7 +46,7 @@
onLoad(option) { onLoad(option) {
// 判断登录 // 判断登录
if (!this.storeToken) { if (!this.storeToken) {
this.$util.redirectTo('/pages_tool/login/login'); this.$util.redirectTo(this.$util.LOGIN_PAGE_URL);
} else { } else {
this.getStatus(); this.getStatus();
} }

View File

@@ -25,7 +25,7 @@
// 判断登录 // 判断登录
if (!this.storeToken) { if (!this.storeToken) {
this.$util.redirectTo('/pages_tool/login/login'); this.$util.redirectTo(this.$util.LOGIN_PAGE_URL);
} else { } else {
this.getStatus(); this.getStatus();
} }

View File

@@ -40,7 +40,7 @@
onShow() { onShow() {
if (!this.storeToken) { if (!this.storeToken) {
this.$util.redirectTo( this.$util.redirectTo(
'/pages_tool/login/login', { this.$util.LOGIN_PAGE_URL, {
back: '/pages_tool/member/modify_face' back: '/pages_tool/member/modify_face'
}, },
'redirectTo' 'redirectTo'

View File

@@ -40,7 +40,7 @@
// 判断登录 // 判断登录
if (!this.storeToken) { if (!this.storeToken) {
this.$util.redirectTo('/pages_tool/login/login'); this.$util.redirectTo(this.$util.LOGIN_PAGE_URL);
} else { } else {
if (this.memberInfo.mobile == '') { if (this.memberInfo.mobile == '') {
uni.showModal({ uni.showModal({

View File

@@ -74,7 +74,7 @@ export default {
onShow() { onShow() {
if (!this.storeToken) { if (!this.storeToken) {
this.$util.redirectTo( this.$util.redirectTo(
'/pages_tool/login/login', this.$util.LOGIN_PAGE_URL,
{ {
back: '/pages_tool/member/point' back: '/pages_tool/member/point'
}, },

View File

@@ -40,7 +40,7 @@ export default {
onShow() { onShow() {
if (!this.storeToken) { if (!this.storeToken) {
this.$util.redirectTo( this.$util.redirectTo(
'/pages_tool/login/login', this.$util.LOGIN_PAGE_URL,
{ {
back: '/pages_tool/member/point' back: '/pages_tool/member/point'
}, },

View File

@@ -69,7 +69,7 @@ export default {
this.getDetail(); this.getDetail();
} else { } else {
this.$util.redirectTo( this.$util.redirectTo(
'/pages_tool/login/login', this.$util.LOGIN_PAGE_URL,
{ {
back: '/pages_tool/member/point' back: '/pages_tool/member/point'
}, },

View File

@@ -91,7 +91,7 @@ export default {
onShow() { onShow() {
// 判断登录 // 判断登录
if (!this.storeToken) { if (!this.storeToken) {
this.$util.redirectTo('/pages_tool/login/login'); this.$util.redirectTo(this.$util.LOGIN_PAGE_URL);
} else { } else {
this.getPackageInfo(); this.getPackageInfo();
} }

View File

@@ -27,7 +27,7 @@ export default {
this.isIphoneX = this.$util.uniappIsIPhoneX(); this.isIphoneX = this.$util.uniappIsIPhoneX();
if (!this.storeToken) { if (!this.storeToken) {
this.$util.redirectTo('/pages_tool/login/login', { this.$util.redirectTo(this.$util.LOGIN_PAGE_URL, {
back: '/pages_tool/order/evaluate?order_id=' + this.orderId back: '/pages_tool/order/evaluate?order_id=' + this.orderId
}, 'redirectTo'); }, 'redirectTo');
} }

View File

@@ -130,7 +130,7 @@ export default {
if (this.storeToken) { if (this.storeToken) {
this.getRefundData(); this.getRefundData();
} else { } else {
this.$util.redirectTo('/pages_tool/login/login', { back: '/pages_tool/order/refund?order_goods_id=' + this.order_goods_id }); this.$util.redirectTo(this.$util.LOGIN_PAGE_URL, { back: '/pages_tool/order/refund?order_goods_id=' + this.order_goods_id });
} }
}, },
methods: { methods: {

View File

@@ -122,7 +122,7 @@ export default {
if (this.storeToken) { if (this.storeToken) {
this.getRefundData(); this.getRefundData();
} else { } else {
this.$util.redirectTo('/pages_tool/login/login', { back: '/pages_tool/order/refund?order_goods_id=' + this.order_goods_id }); this.$util.redirectTo(this.$util.LOGIN_PAGE_URL, { back: '/pages_tool/order/refund?order_goods_id=' + this.order_goods_id });
} }
}, },
methods: { methods: {

View File

@@ -175,7 +175,7 @@ export default {
if (this.storeToken) { if (this.storeToken) {
this.getRefundDetail(); this.getRefundDetail();
} else { } else {
this.$util.redirectTo('/pages_tool/login/login', { back: '/pages_tool/order/refund_detail?order_goods_id=' + this.order_goods_id }); this.$util.redirectTo(this.$util.LOGIN_PAGE_URL, { back: '/pages_tool/order/refund_detail?order_goods_id=' + this.order_goods_id });
} }
}, },
methods: { methods: {

View File

@@ -41,7 +41,7 @@
if (this.storeToken) { if (this.storeToken) {
this.getRefundData(); this.getRefundData();
} else { } else {
this.$util.redirectTo('/pages_tool/login/login', { this.$util.redirectTo(this.$util.LOGIN_PAGE_URL, {
back: '/pages_tool/order/refund?order_goods_id=' + this.order_goods_id back: '/pages_tool/order/refund?order_goods_id=' + this.order_goods_id
}); });
} }

View File

@@ -33,7 +33,7 @@ export default {
onShow() { onShow() {
if (!this.storeToken) { if (!this.storeToken) {
this.$util.redirectTo('/pages_tool/login/login'); this.$util.redirectTo(this.$util.LOGIN_PAGE_URL);
} else { } else {
this.getPayInfo(); this.getPayInfo();
} }