登录页接收到二维码中的参数并成功在wxlogin接口传递

This commit is contained in:
WindowBird 2025-08-22 13:35:28 +08:00
parent 896aff0e00
commit a8756743d5

View File

@ -107,7 +107,6 @@ export default {
// agentId
const agentId = this.getUrlParam('agentId', q)
if (agentId) {
this.setData({ agentId }) // data
this.agentId = agentId //
console.log('成功存入agentId:', this.agentId)
} else {
@ -116,12 +115,6 @@ export default {
}
},
getUrlParam: function (key, url) {
const regex = new RegExp(`[?&]${key}=([^&#]*)`)
const match = url.match(regex)
return match ? decodeURIComponent(match[1]) : null
},
onUnload() {
forceHideLoading()
if (this.pageLoading) {
@ -129,6 +122,11 @@ export default {
}
},
methods: {
getUrlParam(key, url) {
const regex = new RegExp(`[?&]${key}=([^&#]*)`)
const match = url.match(regex)
return match ? decodeURIComponent(match[1]) : null
},
toggleAgreement() {
if (this.hasReadServiceTerms && this.hasReadPrivacyPolicy) {
this.hasAgreed = !this.hasAgreed