refactor: 统一替换登录跳转逻辑为通用方法
将项目内多处手动调用$refs.login.open的登录跳转逻辑,统一替换为新增的redirectTologin通用方法,简化代码并提升维护性,同时统一处理了延迟和nextTick调用逻辑。
This commit is contained in:
@@ -290,16 +290,14 @@ export default {
|
||||
},
|
||||
mixins: [fenxiaoWords],
|
||||
onShow() {
|
||||
if (this.fenxiaoWords && this.fenxiaoWords.concept) this.$langConfig.title(this.fenxiaoWords.concept + this.$lang('center'));
|
||||
|
||||
if (this.storeToken) {
|
||||
this.checkFenxiaoIsStart();
|
||||
} else {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.login.open('/pages_promotion/fenxiao/index', 'redirectTo');
|
||||
});
|
||||
if (!this.storeToken) {
|
||||
this.redirectTologin('/pages_promotion/fenxiao/index');
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.fenxiaoWords && this.fenxiaoWords.concept) this.$langConfig.title(this.fenxiaoWords.concept + this.$lang('center'));
|
||||
|
||||
this.checkFenxiaoIsStart();
|
||||
this.getTemplateId();
|
||||
this.getPoster();
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user