mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-17 13:57:10 +00:00
fix: 生成较长时suno token过期重新刷新
This commit is contained in:
parent
e47ec3cd5c
commit
d004699e21
1 changed files with 4 additions and 0 deletions
|
|
@ -65,6 +65,10 @@ export class SunoClient {
|
||||||
Authorization: `Bearer ${sess}`
|
Authorization: `Bearer ${sess}`
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
if (queryRes.status === 401) {
|
||||||
|
sess = await this.getToken()
|
||||||
|
continue
|
||||||
|
}
|
||||||
if (queryRes.status !== 200) {
|
if (queryRes.status !== 200) {
|
||||||
logger.error(await queryRes.text())
|
logger.error(await queryRes.text())
|
||||||
console.error('Failed to query song')
|
console.error('Failed to query song')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue