yinbangzhong
2024-08-28 5caca0c02d55be32ac91c4ffbb1a5c615293bd3a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import axios from 'axios';
import type { RouteRecordNormalized } from 'vue-router';
import { UserState } from '@/store/modules/user/types';
 
export interface LoginData {
  email: string;
  password: string;
}
 
export interface LoginRes {
  token: string;
}
export function login(data: LoginData) {
  // return axios.post<LoginRes>('/v1/user/login', data);
  return axios.post<LoginRes>('/base/login', data);
}
 
export function logout() {
  return axios.post<LoginRes>('/base/logout');
}
 
export function getUserInfo() {
  return axios.post<UserState>('/api/user/info');
}
 
export function getMenuList() {
  return axios.post<RouteRecordNormalized[]>('/api/user/menu');
}