riku
2022-10-28 b45a01a8bee4a9bff5f9c248ead301b8675d1099
service/userservice.js
@@ -34,10 +34,53 @@
    $f.get(cb)
  },
  //获取用户基础信息
  getBaseInfo: function (userId, fun) {
  getBaseInfo: function (userId, fun, wxUserId) {
    let cb = {
      url: `/userInfo/baseInfo`,
      params: {
        userId: userId
      }
    }
    if (wxUserId) {
      cb.params.wxUserId = wxUserId
    }
    Object.assign(cb, fun)
    $f.get(cb)
  },
  //登录
  loginPW: function (accessTokenPW, fun) {
    let cb = {
      url: '/wxuser/loginPW',
      data: accessTokenPW,
    }
    Object.assign(cb, fun)
    $f.post(cb)
  },
  //场景信息认证
  authScene: function (wxUserId, sceneType, sceneInfo, fun) {
    let cb = {
      url: '/auth/scene',
      params: {
        wxUserId: wxUserId,
        sceneType: sceneType
      },
      data: sceneInfo,
    }
    Object.assign(cb, fun)
    $f.post(cb)
  },
  //获取用户认证状态
  getAuthStatus: function (wxUserId, userId, fun) {
    let cb = {
      url: `/auth/status`,
      params: {
        wxUserId: wxUserId,
        userId: userId
      }
    }
@@ -45,4 +88,29 @@
    $f.get(cb)
  },
  //修改密码
  changePW(userId, oldP, newP, fun) {
    let cb = {
      url: `/userInfo/password/change`,
      params: {
        userId: userId,
        oldPassword: oldP,
        newPassword: newP
      }
    }
    Object.assign(cb, fun)
    $f.post(cb)
  },
  subscribeResult(event, fun) {
    let cb = {
      url: `/wxuser/message/subscribe/result`,
      data: event
    }
    Object.assign(cb, fun)
    $f.post(cb)
  }
}