import request from '@/utils/request'

export function loginByPwd(mobile, password) {
  const params = {
    mobile: mobile,
    password: password
  }
  return request({
    url: '/m/api/login/pwd',
    method: 'post',
    params: params
  })
}

export function isLogin() {
  return request({
    url: '/m/api/islogin',
    method: 'get'
  })
}

export function getCodeInit() {
  return request({
    url: '/m/api/code',
    method: 'get'
  })
}

export function getVerifyCode(params) {
  return request({
    url: '/m/api/getcode',
    method: 'get',
    params: params
  })
}

export function loginByCode(params) {
  return request({
    url: '/m/api/login/cs',
    method: 'post',
    params: params
  })
}

export function forgetPassWord(params) {
  return request({
    url: '/m/api/password/commit',
    method: 'post',
    params: params
  })
}

export function register(params) {
  return request({
    url: '/m/api/register/commit',
    method: 'post',
    params: params
  })
}

export function setName(params) {
  return request({
    url: '/m/api/register/setname',
    method: 'post',
    params: params
  })
}

export function login() {
  return request({
    url: '/m/api/register/login',
    method: 'post'
  })
}

export function createOrg(params) {
  return request({
    url: '/m/api/org/create',
    method: 'post',
    params: params
  })
}

export function getMyMobile(id) {
  const params = {
    id: id
  }
  return request({
    url: '/m/api/org/getMyMobile',
    method: 'get',
    params: params
  })
}
