fix: llm_bridge._decrypt_key 修复 unpassword 参数顺序 + key 默认值兜底,正确解密 confidential_fields 加密的 api_key
This commit is contained in:
parent
42bf89c0c1
commit
853f3d5082
@ -24,8 +24,10 @@ def _decrypt_key(encrypted: str) -> str:
|
||||
from appPublic.rc4 import unpassword
|
||||
from appPublic.jsonConfig import getConfig
|
||||
config = getConfig()
|
||||
key = config.password_key
|
||||
return unpassword(key, encrypted)
|
||||
# 与 ahserver.globalEnv.get_password_key() 一致:password_key 为空时用默认 key
|
||||
key = config.password_key or 'QRIVSRHrthhwyjy176556332'
|
||||
# unpassword(code, key):code=密文,key=密钥(之前参数顺序写反了)
|
||||
return unpassword(encrypted, key)
|
||||
except Exception:
|
||||
return encrypted # already plaintext or decrypt failed
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user