修复系统token验证

This commit is contained in:
whyour 2022-06-18 19:24:56 +08:00
parent 5d6ac7f07c
commit 99d881fc0d

View File

@ -62,7 +62,7 @@ export default ({ app }: { app: Application }) => {
const keyMatch = req.path.match(/\/open\/([a-z]+)\/*/); const keyMatch = req.path.match(/\/open\/([a-z]+)\/*/);
const key = keyMatch && keyMatch[1]; const key = keyMatch && keyMatch[1];
if ( if (
doc.scopes.includes(key as any) && (doc.scopes.includes(key as any) || doc.name === 'system') &&
currentToken && currentToken &&
currentToken.expiration >= Math.round(Date.now() / 1000) currentToken.expiration >= Math.round(Date.now() / 1000)
) { ) {