import {getOpenId} from '../api/login.js' export function getUserInfo() { return new Promise((resolve)=> { wx.getUserProfile({ desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写 success: (res) => { wx.setStorage({ key: 'userInfo', data: res.userInfo }) wx.login({ success: result=> { let code = result.code getOpenId(code).then((data=> { wx.setStorage({ key: 'openId', data: data.data }) resolve({ openId: data.data, userInfo: res.userInfo }) })) } }) } }) }) }