From ff9cd2faee11d474da24d18954bf21c4634728cb Mon Sep 17 00:00:00 2001 From: Wik-T <812952667@qq.com> Date: Mon, 3 Jul 2023 14:22:42 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E6=AD=A3=E5=BC=8F=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 8 +++---- pages/welcome/welcome.vue | 44 +++++++++++++++++++-------------------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/App.vue b/App.vue index 8941b45..de77746 100644 --- a/App.vue +++ b/App.vue @@ -4,11 +4,11 @@ // url: 'http://192.168.3.4:9301/crest', // imgUrl: 'https://192.168.3.4:9301/filesystem/', //正式 - url: 'https://pay.dctpay.com/crest', - imgUrl: 'https://gratia-pay.obs.cn-southwest-2.myhuaweicloud.com', + // url: 'https://pay.dctpay.com/crest', + // imgUrl: 'https://gratia-pay.obs.cn-southwest-2.myhuaweicloud.com', //测试 - // url: 'https://gratia-pay.dctpay.com/crest', - // imgUrl: 'https://gratia-pay-test.obs.cn-east-3.myhuaweicloud.com', + url: 'https://gratia-pay.dctpay.com/crest', + imgUrl: 'https://gratia-pay-test.obs.cn-east-3.myhuaweicloud.com', userInfo: "", openId: '', h5code: '', diff --git a/pages/welcome/welcome.vue b/pages/welcome/welcome.vue index b38752b..7a53063 100644 --- a/pages/welcome/welcome.vue +++ b/pages/welcome/welcome.vue @@ -17,28 +17,28 @@ }, onLoad(options) { let that = this; - uni.reLaunch({ - url: '../tabBar/home/home' - }) + // uni.reLaunch({ + // url: '../tabBar/home/home' + // }) // #ifdef H5 - // let arr1 = window.location.href; - // let arr2 = arr1.split('='); - // if (arr2[2]) { - // var arr3 = arr2[2].split('&'); - // if (arr3[0] != undefined && arr3[0]) { - // app.globalData.h5code = arr3[0]; - // uni.setStorage({ - // key: "h5code", - // data: arr3[0] - // }) - // } - // } else { - // // 获取openid - // that.jumpcdx(); - // } - // if (app.globalData.h5code) { - // that.getAccessToken(); - // } + let arr1 = window.location.href; + let arr2 = arr1.split('='); + if (arr2[2]) { + var arr3 = arr2[2].split('&'); + if (arr3[0] != undefined && arr3[0]) { + app.globalData.h5code = arr3[0]; + uni.setStorage({ + key: "h5code", + data: arr3[0] + }) + } + } else { + // 获取openid + that.jumpcdx(); + } + if (app.globalData.h5code) { + that.getAccessToken(); + } // #endif }, methods: { @@ -71,7 +71,7 @@ }, jumpcdx() { location.href = - 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa075e8509802f826&redirect_uri=https://hsg.dctpay.com/wechat_authorize/?redirect_uri=https://pay.dctpay.com/cweb&response_type=code&scope=snsapi_base#wechat_redirect'; + 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa075e8509802f826&redirect_uri=https://hsg.dctpay.com/wechat_authorize/?redirect_uri=https://gratia-pay.dctpay.com/cweb&response_type=code&scope=snsapi_base#wechat_redirect'; }, } }