Commit 092a1124 authored by xd's avatar xd

Merge branch 'master' of http://114.67.93.201/xulili/ybf

parents 9c249ca7 a2d642ca
......@@ -10,3 +10,4 @@ export function ApiEaPost(inData) {
data: postData
})
}
......@@ -19,24 +19,21 @@ const createSign = (inPostData, inAppSecret) => {
// URL 编码
for (let key in args) {
res += encodeURIComponent(key) + "%3d" + encodeURIComponent(args[key]).toLowerCase() + "%26";
res += encodeURIComponent(key) + "%3D" + encodeURIComponent(args[key]) + "%26";
}
res = res.slice(0, -3);
// URL 拼接
res += `&appUser=${appUser}&appCode=${appCode}&${ts} ${appSecret}`
res += `&appUser=${appUser}&appCode=${appCode}&${ts}${appSecret}`
return res;
};
// Basic Info
let basicInfo = {
// appUser: "user001",
appUser: "YBF001",
// ver: "v2.17",
ver: "v1.0",
appSecret: "JeC0mmE2ZjZmOfdmTGImYzU5Yjg1AYU2M3F="
// appSecret: "JeC0mmE2ZjZmOfdmTGImYzU5Yjg1AYU2M3F="
ver: "v2.17",
appSecret: "t04yYm6gjsuHeehxOxojtmiwlYfXY8Zkdowf"
}
// 创建 axios 实例
......@@ -48,21 +45,18 @@ const service = axios.create({
// request 拦截器
service.interceptors.request.use(
req => {
zlog('--->axios: req.params: start:', req.params)
// zlog('--->axios: req.params: start:', req.params)
let apiMethod = req.method
if (apiMethod === 'post') {
zlog('--->axios: req.data:', req.data)
// zlog('--->axios: req.data:', req.data)
let oldPostData = JSON.parse(JSON.stringify(req.data))
let newPostData = {
appUser: basicInfo.appUser,
// appUser: 'user001',
appCode: oldPostData.args.appCode,
// appCode: '0611',
// ts: String(Date.parse(new Date())),
ts: String(parseInt(new Date().getTime()/1000)),
// ts: '1563355519',
// ts: '1497857409',
// ts: String(parseInt(new Date().getTime()/1000)),
ts: '1563355520',
ver: basicInfo.ver,
args: oldPostData.args
}
......
......@@ -91,13 +91,9 @@ export default {
// },
testEaPost() {
let postData = {
appCode: "0611",
brief: '停车券兑换',
orderNo: '12345678',
point: '123.321',
procType: 46,
updateType: 'dec',
vipId: 1,
appCode: '0603',
condType: 1,
condValue: '138069094',
};
ApiEaPost(postData).then(res => {
console.log(res);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment