🎈 perf(尝试解决正式环境首次进入白屏问题):
This commit is contained in:
+4
-4
@@ -155,7 +155,7 @@ export const useRequest = (
|
||||
data: stateRef.current.query,
|
||||
}
|
||||
: {
|
||||
data: options.type?.toUpperCase() == 'FORMDATA' ? qs.stringify(stateRef.current.query) : stateRef.current.query,
|
||||
data: options.type?.toUpperCase() == 'FORMDATA' ? qs.stringify(stateRef.current?.query) : stateRef.current.query,
|
||||
}),
|
||||
}
|
||||
const result = await Taro.request(q as any)
|
||||
@@ -181,14 +181,14 @@ export const useRequest = (
|
||||
})
|
||||
console.log('错误::', msg)
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (statusCode === 401) {
|
||||
removeToken()
|
||||
removeSessionKey()
|
||||
removeUserInfo()
|
||||
login()
|
||||
}
|
||||
}
|
||||
else {
|
||||
Taro.showToast({
|
||||
title: `错误:${showStatus(statusCode)}`,
|
||||
@@ -196,7 +196,7 @@ export const useRequest = (
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
stateRef.current.success = false
|
||||
stateRef.current.error = true
|
||||
|
||||
Reference in New Issue
Block a user