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