电子商城测试版v3

This commit is contained in:
2022-06-30 20:31:51 +08:00
parent d0d4219413
commit 4ac7890915
22 changed files with 452 additions and 107 deletions
+8
View File
@@ -171,6 +171,13 @@ export const useRequest = (options:option = {
stateRef.current.msg = msg
stateRef.current.data = data
stateRef.current.total = data?.list ? data?.total : 0
if(code !== 0) {
Taro.showToast({
title: `${msg}`,
icon: 'none'
})
console.log('错误::',msg)
}
}else{
if (statusCode === 401) {
removeToken()
@@ -189,6 +196,7 @@ export const useRequest = (options:option = {
stateRef.current.success = false
stateRef.current.error = true
stateRef.current.msg = e.errMsg
console.log('后台错误信息::',e.errMsg)
}
stateRef.current.error = false