import http from '@/utils/request'
// import md5 from 'md5'

/**
 *
 * 是否需要短信验证码登录
 * @export
 * @param {*}
 * params:
 * {"project_name":"demo"}
 * @returns
 */
export function authsmsneed (params) {
  return http.post('/login/authsmsneed', params)
}

/**
 *
 * 发送短信验证码
 * @export
 * @param {*}
 * params:
 * {"project_name":"demo","username":"用户名或者手机号"}
 * @returns
 */
export function authsmssend (params) {
  return http.post('/login/authsmssend', params)
}

/**
 *
 * 登录
 * @export
 * @param {*}
 * params:
 * {"project_name": "demo", "username":"admin", "password":"123456","authcode":"1234"}
 * @returns
 */
export function login (params) {
  return http.post('/login/auth', params)
}

// 获取权限信息
export function getAuthorizationInfo () {
  return http.post('/login/getAuthorizationInfo')
}

// 退出
export function logout () {
  return http.post('/login/logout')
}
