fix: multi windows token sharing

修复同时打开多个窗口时令牌没能同步共享的问题

fixed: #761
This commit is contained in:
无木
2021-06-29 19:41:06 +08:00
parent d7b84c7874
commit e5f37885ff
6 changed files with 44 additions and 4 deletions

View File

@@ -95,4 +95,18 @@ export default [
return resultSuccess(codeList);
},
},
{
url: '/basic-api/logout',
timeout: 200,
method: 'get',
response: (request: requestParams) => {
const token = getRequestToken(request);
if (!token) return resultError('Invalid token');
const checkUser = createFakeUserList().find((item) => item.token === token);
if (!checkUser) {
return resultError('Invalid token!');
}
return resultSuccess(undefined, { message: 'Token has been destroyed' });
},
},
] as MockMethod[];