mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-18 16:54:25 +08:00
code refactor
This commit is contained in:
+2
-1
@@ -41,7 +41,7 @@ axios.interceptors.response.use(response => {
|
||||
&& errorCode <= 202004 // current token type is invalid
|
||||
&& errorCode <= 202005 // current token requires two factor authorization
|
||||
&& errorCode <= 202006) { // current token does not require two factor authorization
|
||||
userState.clearToken();
|
||||
userState.clearTokenAndUserInfo();
|
||||
location.reload();
|
||||
return Promise.reject({ processed: true });
|
||||
}
|
||||
@@ -100,6 +100,7 @@ export default {
|
||||
|
||||
if (data && data.success && data.result && data.result.newToken) {
|
||||
userState.updateToken(data.result.newToken);
|
||||
userState.updateUserInfo(data.result.user);
|
||||
|
||||
if (data.result.oldTokenId) {
|
||||
axios.post('v1/tokens/revoke.json', {
|
||||
|
||||
Reference in New Issue
Block a user