|
|
|
@ -7,10 +7,9 @@ import utils from '@/utils/encode' |
|
|
|
|
//42 洛超 /29 孙志华 /40 阿浩
|
|
|
|
|
// 测试日日顺时需要连阿浩
|
|
|
|
|
|
|
|
|
|
const testUrl = 'http://192.168.0.26:38080' |
|
|
|
|
const testUrl = 'http://192.168.110.77:38080' |
|
|
|
|
// const productionUrl = 'https://www.51xingka.net/oilApp' // 生产,加密 old
|
|
|
|
|
// const productionUrl = 'https://www.xingoil.com/adminapi' // 生产,加密 new
|
|
|
|
|
// const productionUrl = 'https://www.xingoil.com/adminapi' // 生产,加密 new
|
|
|
|
|
const productionUrl = 'http://uat.xingoil.com/adminapi' |
|
|
|
|
// const env = process.env.NODE_ENV // 环境
|
|
|
|
|
const service = axios.create({ |
|
|
|
@ -49,7 +48,7 @@ service.interceptors.request.use( |
|
|
|
|
if (env === 'production') { |
|
|
|
|
// 生产环境,加密,不输出任何东西
|
|
|
|
|
// 设置jsessionid和token
|
|
|
|
|
console.log('这里是生产') |
|
|
|
|
// console.log('这里是生产')
|
|
|
|
|
const JSESSIONID = utils.uuid() |
|
|
|
|
config.headers['JSESSIONID'] = JSESSIONID |
|
|
|
|
config.headers['token'] = utils.md5Salt(JSESSIONID) |
|
|
|
@ -100,13 +99,13 @@ service.interceptors.response.use( |
|
|
|
|
// console.log('生产环境 请求路径', response.config.url, '解密为', res.data)
|
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
console.log('请求路径', response.config.url, '返回结果未加密', res) |
|
|
|
|
console.log('-------------------------------------------') |
|
|
|
|
// console.log('请求路径', response.config.url, '返回结果未加密', res)
|
|
|
|
|
// console.log('-------------------------------------------')
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
uni.hideLoading() |
|
|
|
|
if (res.code != 20000) { |
|
|
|
|
console.log('这里是登录报错处',res) |
|
|
|
|
// console.log('这里是登录报错处',res)
|
|
|
|
|
if(response.config.url.indexOf('/oil-user/oilCustomerChannelRelation/getByPhone/') != -1){ |
|
|
|
|
// uni.hideToast()
|
|
|
|
|
}else{ |
|
|
|
@ -125,23 +124,11 @@ service.interceptors.response.use( |
|
|
|
|
success: function(res) { |
|
|
|
|
if (res.confirm) { |
|
|
|
|
uni.reLaunch({ |
|
|
|
|
url: '/pages/login/boforeLogin/boforeLogin', |
|
|
|
|
success: () => { |
|
|
|
|
console.log('跳转成功') |
|
|
|
|
}, |
|
|
|
|
fail: (err) => { |
|
|
|
|
console.log(err) |
|
|
|
|
} |
|
|
|
|
url: '/pages/login/boforeLogin/boforeLogin' |
|
|
|
|
}) |
|
|
|
|
} else if (res.cancel) { |
|
|
|
|
uni.reLaunch({ |
|
|
|
|
url: '/pages/login/boforeLogin/boforeLogin?type=1', |
|
|
|
|
success: () => { |
|
|
|
|
console.log('跳转成功') |
|
|
|
|
}, |
|
|
|
|
fail: (err) => { |
|
|
|
|
console.log(err) |
|
|
|
|
} |
|
|
|
|
url: '/pages/login/boforeLogin/boforeLogin?type=1' |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -154,13 +141,7 @@ service.interceptors.response.use( |
|
|
|
|
icon: "none" |
|
|
|
|
}) |
|
|
|
|
uni.reLaunch({ |
|
|
|
|
url: '/pages/login/boforeLogin/boforeLogin', |
|
|
|
|
success: () => { |
|
|
|
|
console.log('跳转成功') |
|
|
|
|
}, |
|
|
|
|
fail: (err) => { |
|
|
|
|
console.log(err) |
|
|
|
|
} |
|
|
|
|
url: '/pages/login/boforeLogin/boforeLogin' |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
if(res.code == 42077){ |
|
|
|
@ -169,13 +150,7 @@ service.interceptors.response.use( |
|
|
|
|
icon: "none" |
|
|
|
|
}) |
|
|
|
|
uni.reLaunch({ |
|
|
|
|
url: '/pages/login/boforeLogin/boforeLogin', |
|
|
|
|
success: () => { |
|
|
|
|
console.log('跳转成功') |
|
|
|
|
}, |
|
|
|
|
fail: (err) => { |
|
|
|
|
console.log(err) |
|
|
|
|
} |
|
|
|
|
url: '/pages/login/boforeLogin/boforeLogin' |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -201,7 +176,6 @@ service.interceptors.response.use( |
|
|
|
|
uni.hideLoading() |
|
|
|
|
uni.getNetworkType({ |
|
|
|
|
success: function(res) { |
|
|
|
|
console.log(res.networkType); |
|
|
|
|
if (res.networkType === 'none') { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '没有网啦!', |
|
|
|
|