msb_prod
ch 3 years ago
parent 3636fc2958
commit b2bdc38c30

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-07-08 11:46:30
* @LastEditors: ch
* @LastEditTime: 2022-07-12 10:47:34
* @LastEditTime: 2022-07-12 10:55:29
* @Description: file content
*/
@ -20,9 +20,13 @@ if (ua.includes('micromessenger')) {
const openId = localStorage.getItem('openId');
if (!openId) {
let query = FormatSearchJson(window.location.search);
ApiGetOrderInfo({ payOrderNo: query.payOrderNo }).then(({ result }) => {
const appid = result.prepayWxApp.prepayAppId;
if (query.code) {
ApiGetOpenId({
code : query.code
code: query.code,
appid
}).then(({ error, result }) => {
if (error) {
// uni.$u.toast(error.message);
@ -31,10 +35,9 @@ if (ua.includes('micromessenger')) {
store.commit('SET_OPEN_ID', result.openId);
})
} else {
ApiGetOrderInfo({ payOrderNo: query.payOrderNo }).then(({result}) => {
ApiGetAuthUrl({
appid: result.prepayWxApp.prepayAppId,
appid,
redirectUrl: window.location.href,
scope: 'snsapi_base'
}).then(({ result, error }) => {
@ -49,28 +52,10 @@ if (ua.includes('micromessenger')) {
}
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);
// })
// });
}
})
}
}

Loading…
Cancel
Save