From b3c938c0a5647af478a1afdd818427533d24c314 Mon Sep 17 00:00:00 2001 From: WindowBird <13870814+windows-bird@user.noreply.gitee.com> Date: Thu, 21 Aug 2025 15:07:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=8C=E7=BB=B4=E7=A0=81=E8=BD=AC=E8=B7=B3?= =?UTF-8?q?=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/agents/requestAgent.vue | 7 ++++--- pages/login/login.vue | 7 +++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/pages/agents/requestAgent.vue b/pages/agents/requestAgent.vue index 46a66af..e3d0e0e 100644 --- a/pages/agents/requestAgent.vue +++ b/pages/agents/requestAgent.vue @@ -59,11 +59,12 @@ export default { initQrcodeValue() { const userId = getLocalUserId() if (userId) { - this.qrcodeValue = userId - console.log('使用用户ID作为二维码内容:', userId) + // 构建包含登录页面链接和用户ID的二维码内容 + this.qrcodeValue = `https://wx.ccttiot.com/cf/i?agentId=${userId}` + console.log('二维码内容:', this.qrcodeValue) } else { // 如果没有用户ID,使用默认值 - this.qrcodeValue = '123456' + this.qrcodeValue = 'https://wx.ccttiot.com/cf/i?agentId=123456' console.warn('未找到用户ID,使用默认二维码内容') } }, diff --git a/pages/login/login.vue b/pages/login/login.vue index 3ec9baa..952048b 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -91,6 +91,7 @@ export default { serviceTermsContent: '', privacyPolicyContent: '', scrollTop: 0, + agentId: '', // 添加agentId字段 } }, computed: { @@ -100,6 +101,8 @@ export default { }, onLoad() { this.pageLoading = new AutoLoadingManager() + this.agentId = this.$Route.query.agentId || '' // 获取路由参数 + console.log('登录页面接收到的agentId:', this.agentId) }, onUnload() { forceHideLoading() @@ -237,7 +240,11 @@ export default { console.log('登录!', res) const data = { loginCode: res.code, + agentId: this.agentId, // 携带agentId } + + console.log('登录请求携带的agentId:', this.agentId) + console.log('登录请求数据:', data) if (this.pageLoading) { this.pageLoading.show('登录中...')