mirror of
https://github.com/certd/certd.git
synced 2026-04-24 04:17:25 +08:00
feat: 站点个性化设置
This commit is contained in:
@@ -50,11 +50,11 @@ export class AuthorityMiddleware implements IWebMiddleware {
|
||||
|
||||
let token = ctx.get('Authorization') || '';
|
||||
token = token.replace('Bearer ', '').trim();
|
||||
if (token === '') {
|
||||
if (!token) {
|
||||
//尝试从cookie中获取token
|
||||
token = ctx.cookies.get('token') || '';
|
||||
}
|
||||
if (token === '') {
|
||||
if (!token) {
|
||||
//尝试从query中获取token
|
||||
token = (ctx.query.token as string) || '';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user