修复 getUserProfile

This commit is contained in:
337031187
2021-05-06 10:04:18 +08:00
parent 9caa088890
commit 30734db1f5
3 changed files with 24 additions and 12 deletions

View File

@@ -21,7 +21,7 @@
<button hover-class="none" @click="wechatLogin" class="bg-green btn1">微信登录</button>
<!-- #endif -->
<!-- #ifdef MP -->
<button hover-class="none" open-type="getUserInfo" @getuserinfo="setUserInfo" class="bg-green btn1">微信登录</button>
<button hover-class="none" @tap="getUserProfile" class="bg-green btn1">微信登录</button>
<!-- #endif -->
<!-- <button hover-class="none" @click="isUp = true" class="btn2">手机号登录</button> -->
</view>
@@ -238,6 +238,25 @@
})
});
},
getUserProfile() {
let self = this;
uni.showLoading({
title: '正在登录中'
});
Routine.getUserProfile()
.then(res => {
Routine.getCode()
.then(code => {
self.getWxUser(code, res);
})
.catch(res => {
uni.hideLoading();
});
})
.catch(res => {
uni.hideLoading();
});
},
setUserInfo(e) {
uni.showLoading({
title: '正在登录中'