/*
 * @Author: wjc
 * @Date: 2024-06-12 10:05:12
 * @LastEditors: wjc
 * @LastEditTime: 2024-07-01 11:46:02
 * @Description:
 */
import { request } from '@/utils/request'
import { BasicRes } from '@/models/requestTypes'
import { ILogin, LoginRes, Employees } from '@/models/userTypes'

export function login(data: ILogin) {
  return request.post<BasicRes<LoginRes>>('auth/login', {
    header: {
      entcode: data.entCode,
    },
    data: {
      account: data.account,
      password: data.password,
    },
  })
}

export function logout() {
  return request.get<BasicRes<string>>('auth/logout')
}

export function getUserInfo(data: string) {
  return request<BasicRes<Employees>>({
    url: `auth/employees/${data}`,
    method: 'GET',
  })
}
