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