From be976f939fdcebb5e8fcb4062c058255f607557a Mon Sep 17 00:00:00 2001 From: kk <875203880@qq.com> Date: Mon, 20 Jul 2026 17:55:22 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=80=E5=8C=96state=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/index/index.vue | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index 755cfc1..c8a067b 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -334,7 +334,6 @@ export default { try { // 存入 localStorage(loading 页面复用时 onLoad 不会重新触发,需要从 localStorage 读取) - localStorage.setItem('__auth_action', 'userinfo'); if (this.deviceId) { localStorage.setItem('__auth_device_id', this.deviceId); } @@ -344,12 +343,6 @@ export default { window.location.origin.replace(/^http:/, 'https:') + window.location.pathname ); - // 构建 state(包含 action 和 device_id,回调时原样回传) - const stateObj = { action: 'userinfo' }; - if (this.deviceId) { - stateObj.device_id = this.deviceId; - } - // 用户信息授权:微信用 snsapi_userinfo,支付宝用 auth_user const platform = uni.getStorageSync('platform') || 'wechat'; const scopes = platform === 'alipay' ? 'auth_user' : 'snsapi_userinfo'; @@ -358,7 +351,7 @@ export default { app_no: appNo, scopes: scopes, redirect_uri: redirectUri, - state: JSON.stringify(stateObj), + state: 'userinfo', }); const data = res.data || {};