fix: some error

This commit is contained in:
ChenZhaoYu committed 2023-03-31 13:37:07 +08:00
1 parent 15f3aac88e
commit 40fa028408
3 files changed
+7 -42

No files matched your search

-6
View File
@@ -25,12 +25,6 @@ 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