登录页接收到二维码中的参数并成功在wxlogin接口传递
This commit is contained in:
parent
896aff0e00
commit
a8756743d5
|
|
@ -107,7 +107,6 @@ export default {
|
||||||
// 提取agentId参数
|
// 提取agentId参数
|
||||||
const agentId = this.getUrlParam('agentId', q)
|
const agentId = this.getUrlParam('agentId', q)
|
||||||
if (agentId) {
|
if (agentId) {
|
||||||
this.setData({ agentId }) // 存入data(用于界面显示)
|
|
||||||
this.agentId = agentId // 存入实例属性
|
this.agentId = agentId // 存入实例属性
|
||||||
console.log('成功存入agentId:', this.agentId)
|
console.log('成功存入agentId:', this.agentId)
|
||||||
} else {
|
} 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() {
|
onUnload() {
|
||||||
forceHideLoading()
|
forceHideLoading()
|
||||||
if (this.pageLoading) {
|
if (this.pageLoading) {
|
||||||
|
|
@ -129,6 +122,11 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getUrlParam(key, url) {
|
||||||
|
const regex = new RegExp(`[?&]${key}=([^&#]*)`)
|
||||||
|
const match = url.match(regex)
|
||||||
|
return match ? decodeURIComponent(match[1]) : null
|
||||||
|
},
|
||||||
toggleAgreement() {
|
toggleAgreement() {
|
||||||
if (this.hasReadServiceTerms && this.hasReadPrivacyPolicy) {
|
if (this.hasReadServiceTerms && this.hasReadPrivacyPolicy) {
|
||||||
this.hasAgreed = !this.hasAgreed
|
this.hasAgreed = !this.hasAgreed
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user