mirror of
https://gitee.com/ZhongBangKeJi/crmeb_java.git
synced 2026-04-23 03:58:35 +08:00
修复 getUserProfile
This commit is contained in:
@@ -158,16 +158,12 @@
|
||||
provider: 'apple',
|
||||
timeout: 10000,
|
||||
success(loginRes) {
|
||||
console.log(loginRes, 'loginRes')
|
||||
uni.getUserInfo({
|
||||
uni.getUserProfile({
|
||||
provider: 'apple',
|
||||
success: function(infoRes) {
|
||||
console.log(infoRes.userInfo, 'yyyy')
|
||||
self.appleUserInfo = infoRes.userInfo
|
||||
self.appleLoginApi()
|
||||
|
||||
console.log(self.$store);
|
||||
console.log(infoRes.userInfo);
|
||||
},
|
||||
fail() {
|
||||
uni.showToast({
|
||||
@@ -247,10 +243,9 @@
|
||||
provider: 'weixin',
|
||||
success: function(loginRes) {
|
||||
// 获取用户信息
|
||||
uni.getUserInfo({
|
||||
uni.getUserProfile({
|
||||
provider: 'weixin',
|
||||
success: function(infoRes) {
|
||||
console.log(infoRes.userInfo, 'yyyy')
|
||||
self.appUserInfo = infoRes.userInfo
|
||||
self.wxLoginApi()
|
||||
|
||||
|
||||
@@ -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: '正在登录中'
|
||||
|
||||
Reference in New Issue
Block a user