Skip to content

Commit 6a04893

Browse files
committed
fix(chatgpt/sentinel): use fallback prepare token when chat token is empty
修复了当主聊天令牌为空时,未使用备用准备令牌的问题,确保会话初始化时令牌有效
1 parent 0c40eb7 commit 6a04893

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

‎aurora.exe~‎

-40.1 MB
Binary file not shown.

‎internal/chatgpt/sentinel.go‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,10 +225,14 @@ func InitSentinelWithState(client httpclient.AuroraHttpClient, account *accounts
225225
}
226226

227227
// so 段
228-
if prepare.So.Required && prepare.So.CollectorDX != "" && prepare.So.SnapshotDX != "" && prepare.Token != "" {
228+
chatToken := prepare.Token
229+
if chatToken == "" {
230+
chatToken = prepare.PrepareToken
231+
}
232+
if prepare.So.Required && prepare.So.CollectorDX != "" && prepare.So.SnapshotDX != "" && chatToken != "" {
229233
ts.soSession = so.NewSession(requirementsToken, prepare.So.CollectorDX)
230234
ts.soSnapshotDX = prepare.So.SnapshotDX
231-
ts.soChatToken = prepare.Token
235+
ts.soChatToken = chatToken
232236
ts.soFlow = stateFlow(state, ua)
233237
ts.soSession.Start()
234238
}

0 commit comments

Comments
 (0)