mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-11 23:40:24 +00:00
feat: 安全性提升
This commit is contained in:
@@ -10,7 +10,7 @@ import { isEmpty } from '@webapi/utils/check';
|
||||
// 检查是否使用默认Token
|
||||
export const CheckDefaultTokenHandler: RequestHandler = async (_, res) => {
|
||||
const webuiToken = await WebUiConfig.GetWebUIConfig();
|
||||
if (webuiToken.token === 'napcat') {
|
||||
if (webuiToken.token.startsWith('napcat')) {
|
||||
return sendSuccess(res, true);
|
||||
}
|
||||
return sendSuccess(res, false);
|
||||
|
||||
@@ -47,8 +47,8 @@ export const CreateTerminalHandler: RequestHandler = async (req, res) => {
|
||||
if (isMacOS) {
|
||||
return sendError(res, 'MacOS不支持终端');
|
||||
}
|
||||
if ((await WebUiConfig.GetWebUIConfig()).token === 'napcat') {
|
||||
return sendError(res, '默认密码禁止创建终端');
|
||||
if ((await WebUiConfig.GetWebUIConfig()).token.startsWith('napcat')) {
|
||||
return sendError(res, '该密码禁止创建终端');
|
||||
}
|
||||
try {
|
||||
const { cols, rows } = req.body;
|
||||
|
||||
Reference in New Issue
Block a user