拓恒河湖长制全民护河平台WEB端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 satır
1.0KB

  1. import {getOpenId} from '../api/login.js'
  2. export function getUserInfo() {
  3. return new Promise((resolve)=> {
  4. wx.getUserProfile({
  5. desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
  6. success: (res) => {
  7. wx.setStorage({
  8. key: 'userInfo',
  9. data: res.userInfo
  10. })
  11. wx.login({
  12. success: result=> {
  13. let code = result.code
  14. getOpenId(code).then((data=> {
  15. wx.setStorage({
  16. key: 'openId',
  17. data: data.data
  18. })
  19. resolve({
  20. openId: data.data,
  21. userInfo: res.userInfo
  22. })
  23. }))
  24. }
  25. })
  26. }
  27. })
  28. })
  29. }