更新
This commit is contained in:
@@ -293,16 +293,23 @@
|
|||||||
siteId: item.siteId,
|
siteId: item.siteId,
|
||||||
clientBelong: "ZHONGPIN"
|
clientBelong: "ZHONGPIN"
|
||||||
}
|
}
|
||||||
let user = uni.getStorageSync('user');
|
|
||||||
if (user) {
|
|
||||||
oilSiteApi.getSiteDetailsByKA(data2).then(res => {
|
oilSiteApi.getSiteDetailsByKA(data2).then(res => {
|
||||||
if (res.code == 20000) {
|
if (res.code == 20000) {
|
||||||
this.siteInfo = Object.assign(item, res.data);
|
this.siteInfo = Object.assign(item, res.data);
|
||||||
|
}else {
|
||||||
|
this.siteInfo = item
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
// let user = uni.getStorageSync('user');
|
||||||
this.siteInfo = item;
|
// if (user) {
|
||||||
}
|
// oilSiteApi.getSiteDetailsByKA(data2).then(res => {
|
||||||
|
// if (res.code == 20000) {
|
||||||
|
// this.siteInfo = Object.assign(item, res.data);
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// } else {
|
||||||
|
// this.siteInfo = item;
|
||||||
|
// }
|
||||||
|
|
||||||
},
|
},
|
||||||
makePay() {
|
makePay() {
|
||||||
|
|||||||
@@ -376,18 +376,23 @@
|
|||||||
showQr() {
|
showQr() {
|
||||||
let user = uni.getStorageSync("user");
|
let user = uni.getStorageSync("user");
|
||||||
if (!user) {
|
if (!user) {
|
||||||
uni.showModal({
|
uni.showToast({
|
||||||
content: "登录后才能出示付款码哦",
|
title:'登录后才能出示付款码哦',
|
||||||
confirmText: "去登录",
|
icon:'none'
|
||||||
success: function(res) {
|
})
|
||||||
if (res.confirm) {
|
return
|
||||||
uni.navigateTo({
|
// uni.showModal({
|
||||||
url: "/BagAuth/pages/login/login",
|
// content: "登录后才能出示付款码哦",
|
||||||
});
|
// confirmText: "去登录",
|
||||||
}
|
// success: function(res) {
|
||||||
},
|
// if (res.confirm) {
|
||||||
});
|
// uni.navigateTo({
|
||||||
return;
|
// url: "/BagAuth/pages/login/login",
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
// });
|
||||||
|
// return;
|
||||||
}
|
}
|
||||||
this.showThreeSites = true
|
this.showThreeSites = true
|
||||||
},
|
},
|
||||||
@@ -395,18 +400,23 @@
|
|||||||
toCards() {
|
toCards() {
|
||||||
let user = uni.getStorageSync("user");
|
let user = uni.getStorageSync("user");
|
||||||
if (!user) {
|
if (!user) {
|
||||||
uni.showModal({
|
uni.showToast({
|
||||||
content: "登录后才能查看哦",
|
title:'登录后才能获取加油卡哦',
|
||||||
confirmText: "去登录",
|
icon:'none'
|
||||||
success: function(res) {
|
})
|
||||||
if (res.confirm) {
|
return
|
||||||
uni.navigateTo({
|
// uni.showModal({
|
||||||
url: "/BagAuth/pages/login/login",
|
// content: "登录后才能获取加油卡哦",
|
||||||
});
|
// confirmText: "去登录",
|
||||||
}
|
// success: function(res) {
|
||||||
},
|
// if (res.confirm) {
|
||||||
});
|
// uni.navigateTo({
|
||||||
return;
|
// url: "/BagAuth/pages/login/login",
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
// });
|
||||||
|
// return;
|
||||||
}
|
}
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/BagMoney/pages/oilCards/oilCards'
|
url: '/BagMoney/pages/oilCards/oilCards'
|
||||||
@@ -414,21 +424,21 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
toOrders() {
|
toOrders() {
|
||||||
let user = uni.getStorageSync("user");
|
// let user = uni.getStorageSync("user");
|
||||||
if (!user) {
|
// if (!user) {
|
||||||
uni.showModal({
|
// uni.showModal({
|
||||||
content: "登录后才能查看哦",
|
// content: "登录后才能查看哦",
|
||||||
confirmText: "去登录",
|
// confirmText: "去登录",
|
||||||
success: function(res) {
|
// success: function(res) {
|
||||||
if (res.confirm) {
|
// if (res.confirm) {
|
||||||
uni.navigateTo({
|
// uni.navigateTo({
|
||||||
url: "/BagAuth/pages/login/login",
|
// url: "/BagAuth/pages/login/login",
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
});
|
// });
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
url: '/pages/tabbar/order/orderList/orderList'
|
url: '/pages/tabbar/order/orderList/orderList'
|
||||||
})
|
})
|
||||||
@@ -466,21 +476,21 @@
|
|||||||
|
|
||||||
toDetail(item) {
|
toDetail(item) {
|
||||||
// console.log('siteList',this.siteList)
|
// console.log('siteList',this.siteList)
|
||||||
let user = uni.getStorageSync("user");
|
// let user = uni.getStorageSync("user");
|
||||||
if (!user) {
|
// if (!user) {
|
||||||
uni.showModal({
|
// uni.showModal({
|
||||||
content: "登录后才能查看哦",
|
// content: "登录后才能查看哦",
|
||||||
confirmText: "去登录",
|
// confirmText: "去登录",
|
||||||
success: function(res) {
|
// success: function(res) {
|
||||||
if (res.confirm) {
|
// if (res.confirm) {
|
||||||
uni.navigateTo({
|
// uni.navigateTo({
|
||||||
url: "/BagAuth/pages/login/login",
|
// url: "/BagAuth/pages/login/login",
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
});
|
// });
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
// console.log('item',item)
|
// console.log('item',item)
|
||||||
let itemS = encodeURIComponent(JSON.stringify(item));
|
let itemS = encodeURIComponent(JSON.stringify(item));
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
@@ -535,18 +545,11 @@
|
|||||||
openScan() {
|
openScan() {
|
||||||
let user = uni.getStorageSync("user");
|
let user = uni.getStorageSync("user");
|
||||||
if (!user) {
|
if (!user) {
|
||||||
uni.showModal({
|
uni.showToast({
|
||||||
content: "登录后才能使用扫一扫哦",
|
title:'登录后才能使用扫一扫哦',
|
||||||
confirmText: "去登录",
|
icon:'none'
|
||||||
success: function(res) {
|
})
|
||||||
if (res.confirm) {
|
return
|
||||||
uni.navigateTo({
|
|
||||||
url: "/BagAuth/pages/login/login",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
uni.scanCode({
|
uni.scanCode({
|
||||||
scanType: 'qrCode',
|
scanType: 'qrCode',
|
||||||
|
|||||||
@@ -461,21 +461,21 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
toDetail(item) {
|
toDetail(item) {
|
||||||
let user = uni.getStorageSync("user");
|
// let user = uni.getStorageSync("user");
|
||||||
if (!user) {
|
// if (!user) {
|
||||||
uni.showModal({
|
// uni.showModal({
|
||||||
content: "登录后才能查看哦",
|
// content: "登录后才能查看哦",
|
||||||
confirmText: "去登录",
|
// confirmText: "去登录",
|
||||||
success: function(res) {
|
// success: function(res) {
|
||||||
if (res.confirm) {
|
// if (res.confirm) {
|
||||||
uni.navigateTo({
|
// uni.navigateTo({
|
||||||
url: "/BagAuth/pages/login/login",
|
// url: "/BagAuth/pages/login/login",
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
});
|
// });
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
let itemS = encodeURIComponent(JSON.stringify(item));
|
let itemS = encodeURIComponent(JSON.stringify(item));
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/BagStation/pages/stationDetail/stationDetail?item=${itemS}`,
|
url: `/BagStation/pages/stationDetail/stationDetail?item=${itemS}`,
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ const env = 'production'/* */
|
|||||||
const testUrl = 'http://192.168.110.77:38080'
|
const testUrl = 'http://192.168.110.77:38080'
|
||||||
// const productUrl = 'http://121.196.213.68/adminapi' //预生产
|
// const productUrl = 'http://121.196.213.68/adminapi' //预生产
|
||||||
|
|
||||||
// const productUrl = 'https://www.xingoil.com/adminapi' // 生产,加密 new
|
const productUrl = 'https://www.xingoil.com/adminapi' // 生产,加密 new
|
||||||
const productUrl = 'http://uat.xingoil.com/adminapi' // 生产,加密 new
|
// const productUrl = 'http://uat.xingoil.com/adminapi' // 生产,加密 new
|
||||||
const service = axios.create({
|
const service = axios.create({
|
||||||
baseURL: env == 'production' ? productUrl : testUrl,
|
baseURL: env == 'production' ? productUrl : testUrl,
|
||||||
// baseURL: testUrl,
|
// baseURL: testUrl,
|
||||||
@@ -18,16 +18,13 @@ var url = ''
|
|||||||
|
|
||||||
service.interceptors.request.use(
|
service.interceptors.request.use(
|
||||||
config => {
|
config => {
|
||||||
// 拦截请求
|
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '加载中...'
|
title: '加载中...'
|
||||||
})
|
})
|
||||||
const token = uni.getStorageSync('Authorization') || " "
|
const token = uni.getStorageSync('Authorization') || " "
|
||||||
const unionId = uni.getStorageSync('unionid')
|
const unionId = uni.getStorageSync('unionid')
|
||||||
const openId = uni.getStorageSync('openid')
|
const openId = uni.getStorageSync('openid')
|
||||||
// const accountSources = 'WE_CHAT_PROGRAM'
|
|
||||||
const accountSources = 'LOGIN_MP_WECHAT'
|
const accountSources = 'LOGIN_MP_WECHAT'
|
||||||
// console.log('取出来缓存', token, openid)
|
|
||||||
|
|
||||||
config.headers['openId'] = openId
|
config.headers['openId'] = openId
|
||||||
config.headers['Authorization'] = token
|
config.headers['Authorization'] = token
|
||||||
@@ -40,31 +37,18 @@ service.interceptors.request.use(
|
|||||||
if(config.data.params) {
|
if(config.data.params) {
|
||||||
config.data.params['parentCompanyId'] = parentCompanyId
|
config.data.params['parentCompanyId'] = parentCompanyId
|
||||||
}else config.data['parentCompanyId'] = parentCompanyId
|
}else config.data['parentCompanyId'] = parentCompanyId
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (env === 'production') {
|
if (env === 'production') {
|
||||||
// 生产环境,加密,不输出任何东西
|
|
||||||
// 设置jsessionid和token
|
|
||||||
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)
|
||||||
// if ( encryptWhite.indexOf(config.url) < 0) {
|
const data = {
|
||||||
// if (!notEncrypt && encryptWhite.indexOf(config.url) < 0) {
|
params: ''
|
||||||
// 这是定义在哪的
|
|
||||||
const data = { // 用于存储加密
|
|
||||||
params: '' // 加密后的密文
|
|
||||||
}
|
}
|
||||||
// 要加密
|
|
||||||
data.params = utils.encrypt(JSON.stringify(config.data))
|
data.params = utils.encrypt(JSON.stringify(config.data))
|
||||||
// console.log('参数', config.url, '参数加密前',config.data)
|
|
||||||
config.data = data
|
config.data = data
|
||||||
// }
|
|
||||||
} else {
|
} else {
|
||||||
// console.log('\n\n-----------------------')
|
|
||||||
// console.log('参数', config.url, '参数加密前', config.data)
|
|
||||||
url = config.url
|
url = config.url
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -85,20 +69,14 @@ service.interceptors.response.use(
|
|||||||
const res = response.data
|
const res = response.data
|
||||||
|
|
||||||
if (env === 'production') {
|
if (env === 'production') {
|
||||||
// 生产环境,进行加密解密,不输出日志
|
|
||||||
if (res.encrypt == 1) {
|
if (res.encrypt == 1) {
|
||||||
// 加密的数据,需要解密
|
|
||||||
const dataParam = JSON.parse(utils.decrypt(res.data))
|
const dataParam = JSON.parse(utils.decrypt(res.data))
|
||||||
res.data = JSON.stringify(dataParam) === '{}' ? null : dataParam
|
res.data = JSON.stringify(dataParam) === '{}' ? null : dataParam
|
||||||
// console.log('返回', response.config.url, '返回结果',res)
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
// console.log('返回', response.config.url, '返回结果未加密', res)
|
|
||||||
// console.log('-------------------------------------------\n\n')
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
if(response.config.url.indexOf('/oil-site/oilSiteOrderInfo/getOrderQrCode') === -1){
|
if(response.config.url.indexOf('/oil-site/oilSiteOrderInfo/getOrderQrCode') == -1){
|
||||||
if (res.code != 20000 && res.msg != '令牌为空,不允许操作' && res.msg != '您的ip已经更改,请重新登录' && res.msg != '登录与操作设备不同') {
|
if (res.code != 20000 && res.msg != '令牌为空,不允许操作' && res.msg != '您的ip已经更改,请重新登录' && res.msg != '登录与操作设备不同') {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.msg,
|
title: res.msg,
|
||||||
|
|||||||
Reference in New Issue
Block a user