import axios from 'axios';
import { UserState } from '@/store/modules/user/types';
import type { LoginData, UpdatePwdData } from './types/user';

// 登录
export function login(data: LoginData): Promise<UserState> {
  return axios.post('/api/user/login', data);
}
// 修改密码
export function updatePwd(datas: UpdatePwdData): Promise<UserState> {
  return axios.post('/api/admin/sys/user/update_password', datas);
}
// 退出登录
export function userLogout() {
  return axios.post('/api/user/logout', {});
}
