feat: 修复登录逻辑
This commit is contained in:
@@ -57,6 +57,18 @@ App({
|
||||
});
|
||||
},
|
||||
|
||||
// Force refresh login (e.g. on 401)
|
||||
forceRefreshLogin() {
|
||||
// Reset Promise
|
||||
this.loginPromise = new Promise((resolve, reject) => {
|
||||
this._resolveLogin = resolve;
|
||||
this._rejectLogin = reject;
|
||||
});
|
||||
wx.removeStorageSync('token');
|
||||
this.doLogin();
|
||||
return this.loginPromise;
|
||||
},
|
||||
|
||||
// Method for other pages/utils to wait for login
|
||||
ensureLogin() {
|
||||
// If token exists, resolve immediately
|
||||
|
||||
Reference in New Issue
Block a user