mirror of
https://github.com/kuaifan/dootask.git
synced 2026-06-26 17:22:26 +00:00
fix(system): demo 环境豁免 dooai_key 打码,修复 /ai/gateway/* 401
system_setting=disabled 时按 _key 结尾统一打码会误伤官方网关 token (dooai_key),前端读出打码串后调 /ai/gateway/me 等接口被网关判为非法 token 返回 401。将 dooai_key 从打码规则中单独豁免,原样返回供鉴权。
This commit is contained in:
parent
da36d3b319
commit
b2d54576d0
@ -348,6 +348,10 @@ class SystemController extends AbstractController
|
||||
if (empty($item)) {
|
||||
continue;
|
||||
}
|
||||
// dooai_key 是官方网关 token,需原样返回供鉴权
|
||||
if ($key === 'dooai_key') {
|
||||
continue;
|
||||
}
|
||||
if (str_ends_with($key, '_key') || str_ends_with($key, '_secret')) {
|
||||
$setting[$key] = substr($item, 0, 4) . str_repeat('*', strlen($item) - 8) . substr($item, -4);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user