请求支付宝支付,后端返回form表单处理
aliPay (res) {
// 调用支付宝
this.$router.push({ path: "/alipay", query: { htmls: res.qrCode } })
/******res.qrCode,h后端返回form表单的字段*********/
}
建立新页面alipay.vue
<template>
<div>
<div v-html="apply"></div>
</div>
</template>
<script>
export default {
data () {
return {
apply: ""
}
},
created () {
let form = this.$route.query.htmls
this.apply = form
},
mounted () {
setTimeout(() => {
document.forms[0].submit()
}, 1000)
}
}
</script>
来源:CSDN
作者:sasha-xxx
链接:https://blog.csdn.net/qq_41670378/article/details/104050939