import request from '@/utils/request';
import { encrypt } from '@/utils/jsencrypt' // 公钥,私钥都声明在里面

// 获取用户详细信息
export function getInfo () {
  return request({
    url: '/api/getInfo',
    method: 'get'
  })
}
// 登录方法
export function login (username, password, code, uuid) {
  const data = {
    username,
    password,
    code,
    uuid
  }
  data.username = encrypt(username);
  data.password = encrypt(password);
  return request({
    url: 'api/login',
    method: 'post',
    data: data
  })
}
export function getCodeImg () {
  return request({
    url: '/api/gkyzm',
    method: 'get'
  })
}

// 退出方法
export function logout () {
  return request({
    url: '/api/logout',
    method: 'post'
  })
}

//获取系统名标题
export const systemConfig = (data) => {
  return request({
    url: '/api/open/typz/list',
    method: 'get',
    params: data
  })
}
