liudan 6 months ago
parent 5a1ba2df25
commit 7a98bd3202
  1. 12
      libs/login.js
  2. 21
      pages/users/login/index.vue
  3. 21
      pages/users/wechat_login/index.vue

@ -52,8 +52,11 @@ export function toLogin(push, pathLogin) {
// #ifdef H5 // #ifdef H5
if (isWeixin()) { if (isWeixin()) {
if(Cache.get('WECHAT_APPID')){ if(Cache.get('WECHAT_APPID')){
// uni.navigateTo({
// url: '/pages/users/wechat_login/index',
// });
uni.navigateTo({ uni.navigateTo({
url: '/pages/users/wechat_login/index', url: '/pages/users/login/index',
}); });
}else{ }else{
return uni.navigateTo({ return uni.navigateTo({
@ -72,9 +75,12 @@ export function toLogin(push, pathLogin) {
// #endif // #endif
// #ifdef MP // #ifdef MP
let url let url
// uni.navigateTo({
// url: '/pages/users/wechat_login/index'
// })
uni.navigateTo({ uni.navigateTo({
url: '/pages/users/wechat_login/index' url: '/pages/users/login/index',
}) });
// #endif // #endif
// #ifdef APP-PLUS // #ifdef APP-PLUS
uni.navigateTo({ uni.navigateTo({

@ -73,6 +73,22 @@
</view> </view>
</view> </view>
<!-- #endif --> <!-- #endif -->
<!-- #ifdef MP -->
<view class="appLogin">
<view class="hds">
<span class="line"></span>
<p>其他方式登录</p>
<span class="line"></span>
</view>
<view class="btn-wrapper">
<view class="btn wx" @click="wxLoginMp">
<span class="iconfont icon-s-weixindenglu1"></span>
</view>
</view>
</view>
<!-- #endif -->
</div> </div>
<div class="whiteBg" v-else> <div class="whiteBg" v-else>
<view class="login_title"> <view class="login_title">
@ -291,6 +307,11 @@
// #endif // #endif
}, },
methods: { methods: {
wxLoginMp(){
uni.navigateTo({
url: '/pages/users/wechat_login/index?source=1'
})
},
// #ifdef MP // #ifdef MP
getPhoneNumber(e) { getPhoneNumber(e) {
let that = this; let that = this;

@ -109,6 +109,7 @@
configData: Cache.get('BASIC_CONFIG'), configData: Cache.get('BASIC_CONFIG'),
bindPhone: false, bindPhone: false,
wechat_phone_switch: 0, wechat_phone_switch: 0,
source:0
}; };
}, },
computed:{ computed:{
@ -122,6 +123,7 @@
}, },
onLoad(options) { onLoad(options) {
this.source = options.source
if (uni.getUserProfile) { if (uni.getUserProfile) {
this.canUseGetUserProfile = true this.canUseGetUserProfile = true
} }
@ -214,12 +216,19 @@
uni.hideLoading(); uni.hideLoading();
self.isShow = true; self.isShow = true;
}else{ }else{
this.$util.Tips({ if(self.source==1){
title: '授权成功', uni.switchTab({
icon: 'success' url: '/pages/user/index'
}, { })
tab: 3 }else{
}); this.$util.Tips({
title: '授权成功',
icon: 'success'
}, {
tab: 3
});
}
} }
}else{ }else{
uni.setStorageSync('auth_token',res.data.result.key); uni.setStorageSync('auth_token',res.data.result.key);

Loading…
Cancel
Save