Co-authored-by: qingguo <qingguo@lexin.com>
This commit is contained in:
GQ1994 2025-05-17 12:32:27 +08:00 • committed by GitHub
commit e7659ecd9d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
33 changed files with 89 additions and 83 deletions

View file

@ -2,7 +2,7 @@ import type { AfterResponseHook, BeforeErrorHook, BeforeRequestHook, Hooks } fro
import ky from 'ky'
import type { IOtherOptions } from './base'
import Toast from '@/app/components/base/toast'
import { API_PREFIX, MARKETPLACE_API_PREFIX, PUBLIC_API_PREFIX, WEB_PREFIX } from '@/config'
import { API_PREFIX, MARKETPLACE_API_PREFIX, PUBLIC_API_PREFIX } from '@/config'
import { getInitialTokenV2, isTokenV1 } from '@/app/components/share/utils'
import { getProcessedSystemVariablesFromUrlParams } from '@/app/components/base/chat/utils'
@ -44,7 +44,7 @@ const afterResponseErrorCode = (otherOptions: IOtherOptions): AfterResponseHook
if (!otherOptions.silent)
Toast.notify({ type: 'error', message: data.message })
if (data.code === 'already_setup')
globalThis.location.href = `${WEB_PREFIX}/signin`
globalThis.location.href = `${globalThis.location.origin}/signin`
})
break
case 401: