/*
 * @Description: 对应sys-user-service服务的用户模块接口
 * @Author: zhoupeng
 * @Date: 2020-04-22 16:16:45
 * @LastEditTime: 2020-07-21 15:17:28
 */

import request from '../../../utils/request';
import Config from '../../../utils/config';

/**
 * @description: 用户登录部分
 * @param {type}
 * @return:
 * @author: zhoupeng
 */
export const loginByMobile = data => {
  return request(
    {
      url: Config.apis.cku.user.loginByMobile,
      method: 'POST',
      data,
    },
    'nothing',
  );
};
export const loginByWechat = data => {
  return request(
    {
      url: Config.apis.cku.user.loginByWechat,
      method: 'POST',
      data,
    },
    'nothing',
  );
};

//用户注册
export const registerUser = data => {
  return request(
    {
      url: Config.apis.cku.user.register,
      method: 'POST',
      data,
    },
    'nothing',
  );
};

//获取用户信息
export const info = data => {
  return request(
    {
      url: Config.apis.cku.user.info,
      method: 'GET',
      data,
    },
    'nothing',
  );
};

//保存用户信息
export const save = data => {
  return request(
    {
      url: Config.apis.cku.user.changeInfo,
      method: 'POST',
      data,
    },
    'nothing',
  );
};

export const mapApi = data => {
  return request(
    {
      url: Config.apis.cku.user.mapApi,
      method: 'GET',
      data,
    },
    'mapApi',
  );
};
