refactor: simplify mock setup

This commit is contained in:
张传龙
2022-06-26 18:42:07 +08:00
parent 73c82520ca
commit cb5dd34e17
6 changed files with 5 additions and 9 deletions

12
mock/utils.js Normal file
View File

@@ -0,0 +1,12 @@
export function resolveToken(authorization) {
/**
* * jwt token
* * Bearer + token
* ! 认证方案: Bearer
*/
const reqTokenSplit = authorization.split(' ')
if (reqTokenSplit.length === 2) {
return reqTokenSplit[1]
}
return ''
}