ssoApi.js 1.15 KB
import api from './request'
const path = 'scrm.api.sso.weapp.'
module.exports = {
  /**wx.login登录 */
  jsCodeLogin(data) {
    return api.post({
      // method: `${path}jscode.getOpenId`,
      method: 'scrm.api.sso.weapp.jscode.getOpenIdAndLogin',
      ...data
    }, true)
  },
  /**授权用户信息 */
  authUserInfo(data) {
    return api.post({
      method: 'scrm.api.sso.weapp.auth.userinfo',
      ...data
    },true)
  },
  /**授权手机号 */
  authUserPhone(data) {
    return api.post({
      method: `${path}auth.phone`,
      ...data
    }, true)
  },
  /**根据openId获取用户信息 */
  getUserInfo(data) {
    return api.post({
      method: `${path}userProfile.getUserInfo`,
      ...data
    }, true)
  },
  /**退出 */
  logout() {
    return api.post({
      method: `scrm.api.sso.user.logout`
    }, true)
  },
  //保存用户授权信息

  saveuserProfile(data) {
    return api.post({
      method: `scrm.api.wechat.auth.userProfile.save`,
      ...data
    }, true)
  },
  /**更新客户手机号  */
  updataCustomerPhone(data) {
    return api.post({
      method: `scrm.api.sso.weapp.mark.phone`,
      ...data
    })
  },
}