fix: some error

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

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