From f13b301e61d022787da1ef3e3adcd508b9422096 Mon Sep 17 00:00:00 2001 From: litian <2804272236@qq.com> Date: 星期五, 27 六月 2025 18:28:36 +0800 Subject: [PATCH] 图 --- src/assets/js/weChat/weChat.js | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/assets/js/weChat/weChat.js b/src/assets/js/weChat/weChat.js index 602f7c8..a85fbbd 100644 --- a/src/assets/js/weChat/weChat.js +++ b/src/assets/js/weChat/weChat.js @@ -1,18 +1,17 @@ -import { - appRefCode -} from "@/assets/js/config"; +import { appRefCode } from "@/assets/js/config"; import service from "@/plugin/axios"; let wxAppId = "wxd2941f9abd7ba978"; // 寰俊AppId let WeChat = { - getCode: (state) => { + getCode: state => { // 璋冭捣鎺堟潈锛岃幏鍙朿ode銆傛敞鎰忥細姣忔璋冪敤鏃跺厛娓呴櫎宸插偍瀛樼殑token锛岄伩鍏嶅悗缁烦杞洃鍚埌鏃х殑token锛屼竴鐩�401 const url = window.location.href; + console.log(window.location.href, 1); const routeCode = url.split("#")[1]; - if (routeCode == 'weChatLogin' || routeCode == '/selectLoginMethod') { + if (routeCode == "/weChatLogin" || routeCode == "/selectLoginMethod") { window.location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${wxAppId}&redirect_uri=${encodeURIComponent( - 'https://www.tepcb.com/mobile/textbooks/#/personalCenter' + "https://www.tepcb.com/mobile/textbooks/#/personalCenter" )}&response_type=code&scope=snsapi_userinfo&state=${state}`; } else { window.location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${wxAppId}&redirect_uri=${encodeURIComponent( @@ -92,7 +91,8 @@ const resData = JSON.parse(data); // eslint-disable-next-line WeixinJSBridge.invoke( - "getBrandWCPayRequest", { + "getBrandWCPayRequest", + { appId: resData.appId, // 鍏紬鍙峰悕绉帮紝鐢卞晢鎴蜂紶鍏� timeStamp: resData.timeStamp, // 鏃堕棿鎴� nonceStr: resData.nonceStr, // 闅忔満涓� @@ -100,7 +100,7 @@ signType: resData.signType, // 寰俊绛惧悕鏂瑰紡 paySign: resData.paySign // 寰俊绛惧悕 }, - function (res) { + function(res) { // 浣跨敤浠ヤ笂鏂瑰紡鍒ゆ柇鍓嶇杩斿洖,寰俊鍥㈤槦閮戦噸鎻愮ず锛歳es.err_msg灏嗗湪鐢ㄦ埛鏀粯鎴愬姛鍚庤繑鍥瀘k锛屼絾骞朵笉淇濊瘉瀹冪粷瀵瑰彲闈犮�� if (res.err_msg == "get_brand_wcpay_request:ok") { // 鏀粯鎴愬姛 @@ -121,7 +121,7 @@ callback(flag, res.errMsg || res.err_msg); } } - } + } ); } }; -- Gitblit v1.9.1