Commit 31105cba authored by yyh's avatar yyh

fix 微信支付回调问题

parent 484faa9b
......@@ -140,9 +140,8 @@ export default class Recharge extends Vue {
private async payHandler() {
const { protocol, host } = location;
const { pay_url } = await this.$api.order.pay(this.orderId, this.method);
// location.href = pay_url;
location.href = this.method === 0 ? pay_url : `${pay_url}&redirect_url=${protocol}//${host}/#/rechargeSuccess`;
// &redirect_url=https%3A%2F%2Fwww.wechatpay.com.cn
const redirectUrl = encodeURIComponent(`${protocol}//${host}/#/rechargeSuccess`);
location.href = this.method === 0 ? pay_url : `${pay_url}&redirect_url=${redirectUrl}`;
}
}
</script>
......
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