支持同时cookie登陆与secret硬编码鉴权两种方式

This commit is contained in:
xia-chu
2026-03-19 19:32:58 +08:00
parent e1d3c21529
commit 22dcde4bf3
4 changed files with 18 additions and 21 deletions

View File

@@ -157,11 +157,8 @@ void handle_http_request(const py::object &check_route, const py::object &submit
try {
auto args = getAllArgs(parser);
auto allArgs = ArgsMap(parser, args);
GET_CONFIG(bool, legacy_auth , API::kLegacyAuth);
if (!legacy_auth) {
// 非传统secret鉴权模式Python接口强制要求登录鉴权
CHECK_SECRET();
}
// Python接口要求登录鉴权
CHECK_SECRET();
} catch (std::exception &ex) {
auto ex1 = dynamic_cast<ApiRetException *>(&ex);
if (ex1) {