Commit 42de93a9 authored by Z's avatar Z

Z: Dot: Ua API almost done. sign has problem.

parent 14bec745
......@@ -13,8 +13,8 @@ export function ApiTestCfPost(inData) {
}
return request({
url: '',
method: 'get',
params: postData
method: 'post',
data: postData
})
}
......
import request from '@/utils/bRequestEa'
export function ApiEaPost(inData) {
let postData = {
args: inData
}
return request({
url: '',
method: 'post',
data: postData
})
}
......@@ -33,9 +33,10 @@ const createSign = (inPostData, inAppSecret) => {
let basicInfo = {
// appUser: "user001",
appUser: "YBF001",
ver: "v2.17",
// appSecret: "JeC0mmE2ZjZmOfdmTGImYzU5Yjg1AYU2M3F="
// ver: "v2.17",
ver: "v1.0",
appSecret: "JeC0mmE2ZjZmOfdmTGImYzU5Yjg1AYU2M3F="
// appSecret: "JeC0mmE2ZjZmOfdmTGImYzU5Yjg1AYU2M3F="
}
// 创建 axios 实例
......@@ -47,16 +48,21 @@ 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') {
// log('--->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,
ts: String(Date.parse(new Date())),
// appCode: '0611',
// ts: String(Date.parse(new Date())),
ts: String(parseInt(new Date().getTime()/1000)),
// ts: '1563355519',
// ts: '1497857409',
ver: basicInfo.ver,
args: oldPostData.args
}
......
......@@ -17,7 +17,8 @@
</div>
</div>
</div>
<button class="testButton">Test</button>
<button class="testButton">Test0606</button>
<button class="testButton">Test0606</button>
</div>
......@@ -29,6 +30,9 @@
</template>
<script>
import { ApiTestCfPost, ApiTestEaPost } from "@/api/test/test";
export default {
name: "home",
data() {
......@@ -77,7 +81,9 @@ export default {
},
buttonMainMarketingClick() {
this.$router.push("MainSale");
}
},
testButton(inCode){}
}
};
</script>
......
......@@ -14,7 +14,7 @@
<div class="main-money">{{item.money}}元代金券</div>
</div>
<div class="buttons">
<button class="button-send" @click="testApiCfPost">推送</button>
<button class="button-send" @click="testEaPost">推送</button>
</div>
</div>
<div class="infos-tips">
......@@ -33,7 +33,8 @@
</template>
<script>
import { ApiTestCfPost, ApiTestEaPost } from "@/api/test/main";
// import { ApiTestCfPost, ApiTestEaPost } from "@/api/test/main";
import { ApiEaPost } from "@/api/test/test";
// const log = console.log.bind(console);
export default {
......@@ -77,35 +78,32 @@ export default {
dis: {}
};
},
created() {
},
created() {},
methods: {
testApiCfPost() {
// testEaPost() {
// let postData = {
// appCode: "0606",
// crmActionDate: "2020-01-10"
// };
// ApiEaPost(postData).then(res => {
// console.log(res);
// });
// },
testEaPost() {
let postData = {
appCode: '0606',
crmActionDate: '2020-01-10'
appCode: "0611",
brief: '停车券兑换',
orderNo: '12345678',
point: '123.321',
procType: 46,
updateType: 'dec',
vipId: 1,
};
ApiTestCfPost(postData).then(res => {
ApiEaPost(postData).then(res => {
console.log(res);
});
},
testApiEaPost() {
let postData = {
appCode: '0606',
crmActionDate: '2020-01-10'
};
ApiTestEaPost(postData).then(res => {
console.log(res);
});
},
testButtonClick() {
this.testApiPost()
},
buttonSingleMarketingClick() {
// this.$router.push("");
},
......
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