修复修改任务状态本地免认证

This commit is contained in:
whyour committed 2022-01-25 22:52:27 +08:00
1 parent e13d9ed51b
commit 3131f197b8
7 files changed
+63 -19

No files matched your search

+5 -4
View File
@@ -68,18 +68,19 @@ export default ({ app }: { app: Application }) => {
}
}
const originPath = `${req.baseUrl}${req.path === '/' ? '' : req.path}`;
if (
!headerToken &&
req.path &&
config.apiWhiteList.includes(req.path) &&
req.path !== '/api/crons/status'
originPath &&
config.apiWhiteList.includes(originPath) &&
originPath !== '/api/crons/status'
) {
return next();
}
const remoteAddress = req.socket.remoteAddress;
if (
remoteAddress === '::ffff:127.0.0.1' &&
req.path === '/api/crons/status'
originPath === '/api/crons/status'
) {
return next();
}