去除wx.getUserProfile接口

This commit is contained in:
linfeng 2022-10-31 09:21:06 +08:00
parent ce6d6cffc3
commit 7653cd6e64
2 changed files with 14 additions and 15 deletions

View File

@ -40,12 +40,12 @@
title: '正在登陆' title: '正在登陆'
}); });
var that = this; var that = this;
let userInfo = await this.getUserProfile(); // let userInfo = await this.getUserProfile();
let code = await this.getLoginCode(); let code = await this.getLoginCode();
that.$H.post('user/miniWxlogin', { that.$H.post('user/miniWxlogin', {
code: code, code: code,
username: userInfo.nickName, // username: userInfo.nickName,
avatar: userInfo.avatarUrl, // avatar: userInfo.avatarUrl,
}).then(res => { }).then(res => {
if (res.code === 0) { if (res.code === 0) {
@ -79,17 +79,17 @@
}); });
}); });
}, },
getUserProfile() { // getUserProfile() {
return new Promise((resolve, reject) => { // return new Promise((resolve, reject) => {
wx.getUserProfile({ // wx.getUserProfile({
lang: 'zh_CN', // lang: 'zh_CN',
desc: '用于完善会员资料', // desc: '',
success: res => { // success: res => {
resolve(res.userInfo); // resolve(res.userInfo);
} // }
}); // });
}); // });
} // }
} }
} }

View File

@ -111,7 +111,6 @@
} else { } else {
this.hasLogin = false; this.hasLogin = false;
} }
// this.getMsgNum();
}, },
onShareAppMessage(res) { onShareAppMessage(res) {
let imgURL = 'http://pic.linfeng.tech/logo.png'; let imgURL = 'http://pic.linfeng.tech/logo.png';