@tmsfe/tms-core 0.0.217 → 0.0.219
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/request.js +2 -2
package/package.json
CHANGED
package/src/request.js
CHANGED
|
@@ -433,7 +433,7 @@ export default class Request {
|
|
|
433
433
|
}
|
|
434
434
|
|
|
435
435
|
// 重试case2:token即将过期,静默刷新token,token有效期剩余不足一小时会返回X-Twt-Expire为1
|
|
436
|
-
const needSilentRefreshLogin = res?.header?.['X-Twt-Expire'] === 1;
|
|
436
|
+
const needSilentRefreshLogin = +res?.header?.['X-Twt-Expire'] === 1;
|
|
437
437
|
if (needSilentRefreshLogin) {
|
|
438
438
|
loginRefresh();
|
|
439
439
|
}
|
|
@@ -673,9 +673,9 @@ async function loginRefresh() {
|
|
|
673
673
|
if (!refreshPromise) {
|
|
674
674
|
// 调用runtime的login方法刷新token
|
|
675
675
|
const { tms } = getApp();
|
|
676
|
-
wx.tmsLoginPromise = undefined;
|
|
677
676
|
// 刷新登录态时清除缓存,确保重新走登录流程
|
|
678
677
|
storage.removeItem('sinanCacheUserInfo');
|
|
678
|
+
wx.tmsLoginPromise = undefined;
|
|
679
679
|
try {
|
|
680
680
|
refreshPromise = tms.login();
|
|
681
681
|
const loginInfo = await refreshPromise;
|