mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-23 06:46:09 +08:00
修复退出登录获取token出错
This commit is contained in:
parent
feb22f25b8
commit
5655591215
|
@ -115,9 +115,10 @@ export function createRandomString(min: number, max: number): string {
|
|||
}
|
||||
|
||||
export function getToken(req: any) {
|
||||
const { authorization } = req.headers;
|
||||
const { authorization = '' } = req.headers;
|
||||
if (authorization && authorization.split(' ')[0] === 'Bearer') {
|
||||
return (authorization.split(' ')[1] as string)
|
||||
return (authorization as string)
|
||||
.replace('Bearer ', '')
|
||||
.replace('mobile-', '')
|
||||
.replace('desktop-', '');
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user