refactor: use jsmod.Get for context configuration (by AI)

This commit is contained in:
AI Engineer 2026-06-10 09:52:55 +08:00
parent 38e520c300
commit 63cd9d392a

View File

@ -32,7 +32,7 @@ func init() {
} else { } else {
// 2. 远程数据库前缀校验 // 2. 远程数据库前缀校验
var allowedDSNs []string var allowedDSNs []string
cast.Convert(&allowedDSNs, ctx.Value("AllowedDSNs")) cast.Convert(&allowedDSNs, jsmod.Get(ctx, "AllowedDSNs"))
matched := false matched := false
for _, prefix := range allowedDSNs { for _, prefix := range allowedDSNs {
if strings.HasPrefix(name, prefix) { if strings.HasPrefix(name, prefix) {