二维码转跳登录
This commit is contained in:
parent
2a62263d62
commit
b3c938c0a5
|
|
@ -59,11 +59,12 @@ export default {
|
||||||
initQrcodeValue() {
|
initQrcodeValue() {
|
||||||
const userId = getLocalUserId()
|
const userId = getLocalUserId()
|
||||||
if (userId) {
|
if (userId) {
|
||||||
this.qrcodeValue = userId
|
// 构建包含登录页面链接和用户ID的二维码内容
|
||||||
console.log('使用用户ID作为二维码内容:', userId)
|
this.qrcodeValue = `https://wx.ccttiot.com/cf/i?agentId=${userId}`
|
||||||
|
console.log('二维码内容:', this.qrcodeValue)
|
||||||
} else {
|
} else {
|
||||||
// 如果没有用户ID,使用默认值
|
// 如果没有用户ID,使用默认值
|
||||||
this.qrcodeValue = '123456'
|
this.qrcodeValue = 'https://wx.ccttiot.com/cf/i?agentId=123456'
|
||||||
console.warn('未找到用户ID,使用默认二维码内容')
|
console.warn('未找到用户ID,使用默认二维码内容')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -91,6 +91,7 @@ export default {
|
||||||
serviceTermsContent: '',
|
serviceTermsContent: '',
|
||||||
privacyPolicyContent: '',
|
privacyPolicyContent: '',
|
||||||
scrollTop: 0,
|
scrollTop: 0,
|
||||||
|
agentId: '', // 添加agentId字段
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|
@ -100,6 +101,8 @@ export default {
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.pageLoading = new AutoLoadingManager()
|
this.pageLoading = new AutoLoadingManager()
|
||||||
|
this.agentId = this.$Route.query.agentId || '' // 获取路由参数
|
||||||
|
console.log('登录页面接收到的agentId:', this.agentId)
|
||||||
},
|
},
|
||||||
onUnload() {
|
onUnload() {
|
||||||
forceHideLoading()
|
forceHideLoading()
|
||||||
|
|
@ -237,7 +240,11 @@ export default {
|
||||||
console.log('登录!', res)
|
console.log('登录!', res)
|
||||||
const data = {
|
const data = {
|
||||||
loginCode: res.code,
|
loginCode: res.code,
|
||||||
|
agentId: this.agentId, // 携带agentId
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log('登录请求携带的agentId:', this.agentId)
|
||||||
|
console.log('登录请求数据:', data)
|
||||||
|
|
||||||
if (this.pageLoading) {
|
if (this.pageLoading) {
|
||||||
this.pageLoading.show('登录中...')
|
this.pageLoading.show('登录中...')
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user