修复微信授权bug

This commit is contained in:
weipengfei 2024-03-01 17:40:07 +08:00
parent 0957979d20
commit b3bdfe373a
5 changed files with 63 additions and 59 deletions

View File

@ -12,8 +12,8 @@ let httpApiSix
let wsApi
// 在打包之前请检查当前环境是否正确
const env = 'dev'; // 开发
// const env = 'prod'; // 生产
// const env = 'dev'; // 开发
const env = 'prod'; // 生产
// const env = 'prew'; // 预上线
switch (env) {

View File

@ -206,7 +206,7 @@ class AuthWechat {
} else {
uni.setStorageSync('auth_token', res.data.result.key);
return uni.navigateTo({
url: '/pages/users/login/index'
url: '/pages/users/login/login_copy'
})
}
})

View File

@ -2,8 +2,8 @@
"name" : "惠农生活",
"appid" : "__UNI__3A527D1",
"description" : "",
"versionName" : "1.9.4",
"versionCode" : 194,
"versionName" : "1.9.5",
"versionCode" : 195,
"transformPx" : false,
/* 5+App */
"app-plus" : {

View File

@ -26,6 +26,7 @@
},
onLoad(option) {
console.log(option);
let that = this
const {
code,
@ -33,12 +34,13 @@
} = option;
wechat.auth(code, state)
.then(() => {
// console.log(decodeURIComponent(decodeURIComponent(option.back_url)),'back_url')
console.log('----', decodeURIComponent(decodeURIComponent(option.back_url)),'back_url')
const href = decodeURIComponent(decodeURIComponent(option.back_url))
location.replace(href)
})
.catch((err) => {
location.replace("/");
console.log('----', {...err})
location.replace("/pages/users/login/login_copy");
});
}
};

View File

@ -1,4 +1,5 @@
<template>
<view>
<view class="container" v-if="merchantInfo && !isEmpty">
<view class="v-navbar">
<u-navbar title="面对面收款" :safeAreaInsetTop="false" :fixed="false" :autoBack="true" bgColor="transparent"
@ -51,6 +52,7 @@
<!-- 登陆 -->
<authorize :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse" @onLoadFun="onLoadFun"></authorize>
</view>
</view>
</template>
<script>