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

@ -73,6 +73,22 @@
</view>
</view>
<!-- #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 class="whiteBg" v-else>
<view class="login_title">
@ -291,6 +307,11 @@
// #endif
},
methods: {
wxLoginMp(){
uni.navigateTo({
url: '/pages/users/wechat_login/index?source=1'
})
},
// #ifdef MP
getPhoneNumber(e) {
let that = this;

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

Loading…
Cancel
Save