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