From 3393797caf56c3d756d56a6ce43fe615c4411612 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=B9=8F?= <zp4185024@163.com> Date: Thu, 13 Feb 2025 09:01:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BF=AB=E6=8D=B7=E7=99=BB=E9=99=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 2 +- sub/common/waiting.vue | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/App.vue b/App.vue index 84d043c..42b2761 100644 --- a/App.vue +++ b/App.vue @@ -77,7 +77,7 @@ export default { state: 'default', userType: this.getUserType() } - setOpenId(res.code); + setOpenId(res.code); // 系统登录 this.$store.dispatch('Login', data).then(() => { this.loginSuccess() diff --git a/sub/common/waiting.vue b/sub/common/waiting.vue index 7f6985d..4e88277 100644 --- a/sub/common/waiting.vue +++ b/sub/common/waiting.vue @@ -1,7 +1,7 @@ <template> <view class="wd-flex wd-flex-col wd-flex-center" style="height: 100%; gap: 10px"> <icon type="waiting" size="40" /> - <button click="btnLogin">允许登陆</button> + <button @tap="btnLogin">允许登陆</button> </view> </template> @@ -13,29 +13,30 @@ export default { data() { - return {} + return { + scene:"" + } }, onShow(res) { console.log(res) }, - + methods: { btnLogin() { - const scene = decodeURIComponent(query.scene) + const openid = getOpenId() - console.log('登陆信息发送', scene) + console.log('登陆信息发送', this.scene) console.log('opeid', openid) qrLogin({ - code:scene, - openid:openid + code:this.scene, + openid:getAccessToken() }) } }, onLoad(query) { // scene 需要使用 decodeURIComponent 才能获取到生成二维码时传入的 scene - const scene = decodeURIComponent(query.scene) - console.log('登陆信息发送', scene) + this.scene = decodeURIComponent(query.scene) }