feat: support escaping the comma character in the API key. (#5088)

feat: support escaping the comma character in the API key.
This commit is contained in:
chenxi 2025-04-20 10:25:28 +08:00 committed by GitHub
parent 5bfa13112a
commit 60680936d3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -206,8 +206,9 @@ const ProviderSetting: FC<Props> = ({ provider: _provider }) => {
if (apiKey.includes(',')) { if (apiKey.includes(',')) {
const keys = apiKey const keys = apiKey
.split(',') .split(/(?<!\\),/)
.map((k) => k.trim()) .map((k) => k.trim())
.map(k => k.replace(/\\,/g, ','))
.filter((k) => k) .filter((k) => k)
const result = await ApiCheckPopup.show({ const result = await ApiCheckPopup.show({