mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-16 13:27:08 +00:00
fix: 可能能解决findIndex
This commit is contained in:
parent
bdad936c70
commit
508beaece3
1 changed files with 2 additions and 2 deletions
|
|
@ -1631,8 +1631,8 @@ export class chatgpt extends plugin {
|
|||
}
|
||||
|
||||
// 如果token曾经有异常,则清除异常
|
||||
let Tokens = JSON.parse(await redis.get('CHATGPT:BING_TOKENS'))
|
||||
const TokenIndex = Tokens.findIndex(element => element.Token === abtrs.bingToken)
|
||||
let Tokens = JSON.parse((await redis.get('CHATGPT:BING_TOKENS')) || '[]')
|
||||
const TokenIndex = Tokens?.findIndex(element => element.Token === abtrs.bingToken)
|
||||
if (TokenIndex > 0 && Tokens[TokenIndex].exception) {
|
||||
delete Tokens[TokenIndex].exception
|
||||
await redis.set('CHATGPT:BING_TOKENS', JSON.stringify(Tokens))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue