提交 4742dfcb authored 作者: haodaking's avatar haodaking

小程序登录用户信息接口调整

上级 b4a30ea6
......@@ -42,7 +42,8 @@ Page({
},
// 获取用户信息
getUserInfo(callback) {
wx.getUserInfo({
wx.getUserProfile({
desc: '登录注册',
success(res) {
callback && callback(res)
},
......@@ -53,10 +54,10 @@ Page({
},
// 微信登录
wechatLogin() {
// 获取code
this.getCode(code => {
// 获取用户信息
this.getUserInfo(user => {
// 获取用户信息
this.getUserInfo(user => {
// 获取code
this.getCode(code => {
const { encryptedData, iv } = user
api.wechatLogin({ encryptedData, iv, code, identity: 'caas-mini' }).then(response => {
if (response.code === 0) {
......
......@@ -11,7 +11,7 @@
hover-class="none"
class="login-button"
open-type="getUserInfo"
bindgetuserinfo="wechatLogin"
bindtap="wechatLogin"
>
微信登录
</button>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论