mirror of
https://github.com/jackhh66/ChatGPT_Web_accessToken.git
synced 2026-12-03 20:59:33 +00:00
feat: add typing effect (#1017)
* feat: add typing effect * fix: ts2339 xxx not exist on type 'never' --------- Co-authored-by: WangYi <wangyi@windimg.com>
This commit is contained in:
1 parent
468bed7705
commit
c0f4af05e3
4 files changed
+46
-15
No files matched your search
@@ -25,6 +25,12 @@ function http<T = any>(
|
||||
const successHandler = (res: AxiosResponse<Response<T>>) => {
|
||||
const authStore = useAuthStore()
|
||||
|
||||
if (typeof res.data === 'string') {
|
||||
const lastIndex = (res.data as string).lastIndexOf('\n')
|
||||
if (lastIndex !== -1)
|
||||
res.data = JSON.parse((res.data as string).substring(lastIndex))
|
||||
}
|
||||
|
||||
if (res.data.status === 'Success' || typeof res.data === 'string')
|
||||
return res.data
|
||||
|
||||
|
||||
Reference in new issue
Block a user