ssoApi.js 1.41 KB
import api from './request'
const path = 'scrm.api.sso.weapp.'
module.exports = {
  /**wx.login登录 */
  jsCodeLogin(data) {
    return api.post({
      method: `${path}jscode.login`,
      ...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)
  },
  /**退出 */
  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
    })
  },
  /**展会演示 openId登录系统 */
  loginByOpenId(data) {
    return api.post({
      method: `scrm.api.sso.weapp.auth.openIdLogin`,
      ...data
    })
  },

  /**获取验证码 */
  getSmsCode(data) {
    return api.post({
      method: `scrm.api.sso.sms.login.get.captcha`,
      ...data
    }, true)
  },
  /*
   *手机号短信登录
   */
  phoneLogin(data) {
    return api.post({
      method: 'scrm.api.sso.weapp.auth.phone.mini',
      source: 'MINIAPP',
      ...data
    }, true)
  }
}