From 3636fc29584f7ea47c241d8c9899478d9ee10ab6 Mon Sep 17 00:00:00 2001 From: ch Date: Tue, 12 Jul 2022 10:50:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.js | 56 ++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 38 insertions(+), 18 deletions(-) diff --git a/src/main.js b/src/main.js index 6caef2a..ddde5c3 100644 --- a/src/main.js +++ b/src/main.js @@ -2,7 +2,7 @@ * @Author: ch * @Date: 2022-07-08 11:46:30 * @LastEditors: ch - * @LastEditTime: 2022-07-09 18:18:11 + * @LastEditTime: 2022-07-12 10:47:34 * @Description: file content */ @@ -31,24 +31,44 @@ if (ua.includes('micromessenger')) { store.commit('SET_OPEN_ID', result.openId); }) } else { - - ApiGetOpenId({ payOrderNo: query.payOrderNo }).then(res => { - ApiGetAuthUrl({ - redirectUrl : window.location.href, - scope : 'snsapi_base' - }).then(({result, error}) => { - if(error){ - // uni.$u.toast(error.message); - uni.showToast({ - title: error.message, - icon: 'none', - duration : 2000 - }) - return false; - } - window.location.replace(result); + ApiGetOrderInfo({ payOrderNo: query.payOrderNo }).then(({result}) => { + + ApiGetAuthUrl({ + appid: result.prepayWxApp.prepayAppId, + redirectUrl : window.location.href, + scope : 'snsapi_base' + }).then(({result, error}) => { + if(error){ + // uni.$u.toast(error.message); + uni.showToast({ + title: error.message, + icon: 'none', + duration : 2000 + }) + return false; + } + window.location.replace(result); + }); }) - }); + + + // ApiGetOpenId({ payOrderNo: query.payOrderNo }).then(res => { + // ApiGetAuthUrl({ + // redirectUrl : window.location.href, + // scope : 'snsapi_base' + // }).then(({result, error}) => { + // if(error){ + // // uni.$u.toast(error.message); + // uni.showToast({ + // title: error.message, + // icon: 'none', + // duration : 2000 + // }) + // return false; + // } + // window.location.replace(result); + // }) + // }); } }