状态码400的时候跳转登录。首页顶部接口返回
This commit is contained in:
parent
5792762c86
commit
51d273314e
|
|
@ -75,6 +75,7 @@ function commonsProcess(showLoading, httpReqCallback) {
|
|||
} = httpData
|
||||
// 避免混淆重新命名
|
||||
let bodyData = data
|
||||
console.log(statusCode,1111111111)
|
||||
if (statusCode == 500) {
|
||||
isShowErrorToast = true
|
||||
return Promise.reject(bodyData) // 跳转到catch函数
|
||||
|
|
@ -124,7 +125,7 @@ function commonsProcess(showLoading, httpReqCallback) {
|
|||
return Promise.resolve(bodyData)
|
||||
|
||||
}).catch(res => {
|
||||
if(res.status==401){
|
||||
if(res.status==401||res.status==400){
|
||||
storageManage.token(null, true)
|
||||
infoBox.showErrorToast('请登录').then(() => {
|
||||
go.to("PAGES_LOGIN", {}, go.GO_TYPE_RELAUNCH)
|
||||
|
|
@ -183,7 +184,6 @@ function request(args) {
|
|||
} = args
|
||||
let headerObject = {}
|
||||
// headerObject[appConfig.tokenKey] = storageManage.token()
|
||||
|
||||
return commonsProcess(showLoading, () => {
|
||||
return uni.request(
|
||||
Object.assign({
|
||||
|
|
|
|||
Loading…
Reference in New Issue