This commit is contained in:
xiaozhiyong
2024-11-13 13:21:59 +08:00
parent 81e136096d
commit c501ba0a53
14 changed files with 2337 additions and 27 deletions

View File

@@ -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