Commit acd5a129 by wenyang

优化H5用支付宝支付时跳转浏览器打开的Token问题

parent 33d4cccd
......@@ -446,7 +446,23 @@
confirmIntergralDeduction() {
},
courseDetailLoad(option) {
this.courseDetail();
this.queryByUserIdFortuneStatistic()
this.deviceType = common.checkDeviceType();
if (this.deviceType == 3) {
this.paymentMethod = 1;
}
if (this.isRedirect == 1) {
this.deductionCore = option.deductionCore;
this.amount = Number(option.amount);
this.isDeduction = String(option.isDeduction);
this.calculatedPrice = Number(this.amount);
setTimeout(() => {
this.pay();
}, 500)
}
},
},
onLoad(option) {
this.fileId = option.fileId;
......@@ -455,35 +471,24 @@
this.userId = option.userId;
}
this.isRedirect = option.isRedirect;
if (this.isRedirect == 1 && uni.getStorageSync('cffp_userId')) {
if (this.isRedirect == 1 && option.userId) {
uni.request({
url: '/api/authorize/obtainToken',
method: 'POST',
data: {ticket:'uni-app', loginId:uni.getStorageSync('cffp_userId')},
data: {ticket:'uni-app', loginId:option.userId},
success: (res) => {
if (res.statusCode === 200) {
uni.setStorageSync('uni-token', res.data['data']['token']);
uni.setStorageSync('cffp_userId', option.userId);
uni.setStorageSync('isLogin','1');
uni.setStorageSync('isH5', 1);
this.courseDetailLoad(option);
}
}
});
}else{
this.courseDetailLoad(option);
}
this.courseDetail();
this.queryByUserIdFortuneStatistic()
this.deviceType = common.checkDeviceType();
if (this.deviceType == 3) {
this.paymentMethod = 1;
}
if (this.isRedirect == 1) {
this.deductionCore = option.deductionCore;
this.amount = Number(option.amount);
this.isDeduction = String(option.isDeduction);
this.calculatedPrice = Number(this.amount);
setTimeout(() => {
this.pay();
}, 500)
}
},
mounted() {}
}
......
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