mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-18 06:17:06 +00:00
fix: whole key
This commit is contained in:
parent
e11a299dfe
commit
1a83d275e7
1 changed files with 1 additions and 3 deletions
|
|
@ -268,12 +268,10 @@ config.version = defaultConfig.version
|
||||||
export const Config = new Proxy(config, {
|
export const Config = new Proxy(config, {
|
||||||
get(target, property) {
|
get(target, property) {
|
||||||
if (property === 'geminiKey') {
|
if (property === 'geminiKey') {
|
||||||
// 如果配置中的geminiKey包含逗号,说明是多个key
|
|
||||||
if (typeof target[property] === 'string' && target[property].includes(',')) {
|
if (typeof target[property] === 'string' && target[property].includes(',')) {
|
||||||
const keys = target[property].split(',').map(key => key.trim()).filter(Boolean)
|
const keys = target[property].split(',').map(key => key.trim()).filter(Boolean)
|
||||||
// 随机返回其中一个key
|
|
||||||
const selectedKey = keys[Math.floor(Math.random() * keys.length)]
|
const selectedKey = keys[Math.floor(Math.random() * keys.length)]
|
||||||
console.log(`[ChatGPT-Plugin] 当前使用的Gemini Key: ${selectedKey.slice(0, 8)}...`) // 只显示key的前8位,后面用...代替
|
console.log(`[ChatGPT-Plugin] 当前使用的Gemini Key: ${selectedKey`)
|
||||||
return selectedKey
|
return selectedKey
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue