更新
This commit is contained in:
@@ -5,8 +5,8 @@ import utils from '@/utils/encode'
|
||||
const env = 'production'
|
||||
const testUrl = 'http://192.168.110.77:38080'
|
||||
|
||||
// const productUrl = 'https://www.xingoil.com/adminapi'
|
||||
const productUrl = 'http://uat.xingoil.com/adminapi'
|
||||
const productUrl = 'https://www.xingoil.com/adminapi'
|
||||
// const productUrl = 'http://uat.xingoil.com/adminapi'
|
||||
|
||||
const service = axios.create({
|
||||
baseURL: env == 'production' ? productUrl : testUrl,
|
||||
@@ -90,6 +90,19 @@ service.interceptors.response.use(
|
||||
}
|
||||
|
||||
uni.hideLoading()
|
||||
if (res.msg == '登录已过期!') {
|
||||
uni.showModal({
|
||||
title: '登录已过期',
|
||||
content: '是否重新登录',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
uni.redirectTo({
|
||||
url: '/pages/login/login',
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
if (response.config.url.indexOf('/oil-site/oilSiteOrderInfo/getOrderQrCode') === -1) {
|
||||
// console.log(res, '----------------------------------')
|
||||
if (res.code != 20000 && res.msg != '令牌为空,不允许操作' && res.msg != '您的ip已经更改,请重新登录' && res.msg !=
|
||||
@@ -98,29 +111,23 @@ service.interceptors.response.use(
|
||||
title: res.msg,
|
||||
icon: "none"
|
||||
})
|
||||
|
||||
return Promise.reject()
|
||||
}
|
||||
|
||||
}
|
||||
if(res.msg=='登录已过期!'){
|
||||
uni.showModal({
|
||||
title:'登录已过期',
|
||||
content:'是否重新登录',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
uni.redirectTo({
|
||||
url:'/pages/login/login',
|
||||
fail(e) {
|
||||
console.log(e)
|
||||
}
|
||||
})
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
// if (res.msg == '登录已过期!') {
|
||||
// uni.showModal({
|
||||
// title: '登录已过期',
|
||||
// content: '是否重新登录',
|
||||
// success: function(res) {
|
||||
// if (res.confirm) {
|
||||
// uni.redirectTo({
|
||||
// url: '/pages/login/login',
|
||||
// })
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
return res
|
||||
},
|
||||
error => {
|
||||
@@ -175,4 +182,4 @@ service.defaults.adapter = function(config) {
|
||||
}
|
||||
// #endif
|
||||
|
||||
export default service
|
||||
export default service
|
||||
Reference in New Issue
Block a user