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:
@@ -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