拓恒河湖长制全民护河平台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.

21 lines
613B

  1. import {getOpenId, getUserData} from '../api/login.js'
  2. export function getOpenidData() {
  3. return new Promise((resolve)=> {
  4. wx.login({
  5. success: result=> {
  6. let code = result.code
  7. getOpenId(code).then(i=> {
  8. if(i.code === 0) {
  9. const openid = i.data
  10. wx.setStorage({
  11. key: 'openid',
  12. data: openid
  13. })
  14. resolve({openid})
  15. }
  16. })
  17. }
  18. })
  19. })
  20. }