Skip to content

Commit d1459ff

Browse files
authored
Update api_validate.js
修复猫ds pwd问题
1 parent d040028 commit d1459ff

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Diff for: utils/api_validate.js

+8
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@ export const validatePwd = async (request, reply) => {
4242
if (!apiPwd) {
4343
return; // 如果未配置 API_PWD,直接通过
4444
}
45+
if (request.url.startsWith('/config/')) {
46+
let cf_path = request.url.slice(8).split('?')[0];
47+
// console.log(cf_path);
48+
if (['index.js', 'index.js.md5', 'index.config.js', 'index.config.js.md5'].includes(cf_path)) {
49+
return
50+
}
51+
console.log(`[validatePwd] 猫配置文件 ${cf_path} 进入鉴权`);
52+
}
4553

4654
// 从查询参数或请求体中获取 pwd
4755
const pwd = request.query.pwd || request.body?.pwd;

0 commit comments

Comments
 (0)