From 8a8393eede6747a0f48e12062e537342cf3afc6a Mon Sep 17 00:00:00 2001 From: sexygoat <1538832180@qq.com> Date: Fri, 17 Apr 2026 16:57:09 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=89=AB=E4=B8=80=E6=89=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/wxsdk.js | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/utils/wxsdk.js b/utils/wxsdk.js index 2baedd6..8c14487 100644 --- a/utils/wxsdk.js +++ b/utils/wxsdk.js @@ -15,7 +15,7 @@ export async function initWxConfig() { return new Promise((resolve, reject) => { wx.config({ - debug: true, + debug: false, appId: app_id, timestamp: timestamp, nonceStr: nonce_str, @@ -42,16 +42,7 @@ export async function initWxConfig() { * @returns {Promise} 扫码结果字符串 */ export function wxScan() { - console.log('wx 对象:', wx) - console.log('window.wx:', window.wx) - console.log('window.jWeixin:', window.jWeixin) return new Promise((resolve, reject) => { - if (!wx) { - const msg = 'wx 对象不存在,请在微信环境中使用' - console.error(msg) - reject(new Error(msg)) - return - } wx.scanQRCode({ needResult: 1, scanType: ['qrCode', 'barCode'], @@ -61,7 +52,7 @@ export function wxScan() { }, fail(err) { console.error('扫码失败:', err) - reject(new Error(err?.errMsg || JSON.stringify(err) || '扫码失败')) + reject(err) } }) })