mirror of
https://github.com/whyour/qinglong.git
synced 2026-12-01 01:39:52 +08:00
修复spawn可能中断,修复token过期任务状态修改
This commit is contained in:
1 parent
71d7d3818f
commit
517fdcc8ec
2 files changed
+12
-6
No files matched your search
@@ -30,6 +30,13 @@ export default ({ app }: { app: Application }) => {
|
||||
if (!headerToken && req.path && req.path === '/api/login') {
|
||||
return next();
|
||||
}
|
||||
const remoteAddress = req.socket.remoteAddress;
|
||||
if (
|
||||
remoteAddress === '::ffff:127.0.0.1' &&
|
||||
req.path === '/api/crons/status'
|
||||
) {
|
||||
return next();
|
||||
}
|
||||
const err: any = new Error('UnauthorizedError');
|
||||
err['status'] = 401;
|
||||
next(err);
|
||||
|
||||
Reference in new issue
Block a user