login-authorization-v2 2.1.6 → 2.1.8-beta.0
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/dist/index.esm.js +3 -3
- package/dist/index.umd.js +3 -3
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -267,7 +267,7 @@ const initInstance = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
267
267
|
});
|
|
268
268
|
instance.interceptors.response.use((response) => {
|
|
269
269
|
if (response.data.code !== 200) {
|
|
270
|
-
return Promise.reject(response
|
|
270
|
+
return Promise.reject(response);
|
|
271
271
|
}
|
|
272
272
|
return response;
|
|
273
273
|
}, (error) => {
|
|
@@ -361,7 +361,6 @@ const make = (config) => {
|
|
|
361
361
|
.then((userInfo) => __awaiter(void 0, void 0, void 0, function* () {
|
|
362
362
|
const valid = detectUserInfoGroupAuth(userInfo);
|
|
363
363
|
if (!valid) {
|
|
364
|
-
openDialog();
|
|
365
364
|
return Promise.reject();
|
|
366
365
|
}
|
|
367
366
|
return config.needMenus
|
|
@@ -401,12 +400,13 @@ const make = (config) => {
|
|
|
401
400
|
const valid = detectUserInfoGroupAuth(userInfo);
|
|
402
401
|
if (!valid) {
|
|
403
402
|
clearRefreshTokenTimer();
|
|
404
|
-
openDialog();
|
|
405
403
|
return logout();
|
|
406
404
|
}
|
|
407
405
|
})
|
|
408
406
|
.catch(error => {
|
|
409
407
|
clearRefreshTokenTimer();
|
|
408
|
+
setAccessToken(null);
|
|
409
|
+
setRefreshToken(null);
|
|
410
410
|
throw error;
|
|
411
411
|
});
|
|
412
412
|
}, 1e3 * 60 * 3); // 3 minutes
|
package/dist/index.umd.js
CHANGED
|
@@ -269,7 +269,7 @@
|
|
|
269
269
|
});
|
|
270
270
|
instance.interceptors.response.use((response) => {
|
|
271
271
|
if (response.data.code !== 200) {
|
|
272
|
-
return Promise.reject(response
|
|
272
|
+
return Promise.reject(response);
|
|
273
273
|
}
|
|
274
274
|
return response;
|
|
275
275
|
}, (error) => {
|
|
@@ -363,7 +363,6 @@
|
|
|
363
363
|
.then((userInfo) => __awaiter(void 0, void 0, void 0, function* () {
|
|
364
364
|
const valid = detectUserInfoGroupAuth(userInfo);
|
|
365
365
|
if (!valid) {
|
|
366
|
-
openDialog();
|
|
367
366
|
return Promise.reject();
|
|
368
367
|
}
|
|
369
368
|
return config.needMenus
|
|
@@ -403,12 +402,13 @@
|
|
|
403
402
|
const valid = detectUserInfoGroupAuth(userInfo);
|
|
404
403
|
if (!valid) {
|
|
405
404
|
clearRefreshTokenTimer();
|
|
406
|
-
openDialog();
|
|
407
405
|
return logout();
|
|
408
406
|
}
|
|
409
407
|
})
|
|
410
408
|
.catch(error => {
|
|
411
409
|
clearRefreshTokenTimer();
|
|
410
|
+
setAccessToken(null);
|
|
411
|
+
setRefreshToken(null);
|
|
412
412
|
throw error;
|
|
413
413
|
});
|
|
414
414
|
}, 1e3 * 60 * 3); // 3 minutes
|