2024-10-15 15:37:50 +08:00
|
|
|
import { Login } from './interface'
|
|
|
|
|
import { ADMIN as rePrefix } from '@/api/config/serviceName'
|
|
|
|
|
import http from '@/api'
|
|
|
|
|
/**
|
|
|
|
|
* @name 登录模块
|
|
|
|
|
*/
|
|
|
|
|
// 用户登录
|
|
|
|
|
export const loginApi = (params: Login.ReqLoginForm) => {
|
2024-11-04 09:58:00 +08:00
|
|
|
return http.post<Login.ResLogin>(`${rePrefix}/login`, params, { loading: false })
|
2024-11-01 16:27:04 +08:00
|
|
|
//return http.post<Login.ResLogin>(`/Register1`, params, { loading: false })
|
2024-10-15 15:37:50 +08:00
|
|
|
}
|
|
|
|
|
// 获取菜单列表
|
|
|
|
|
export const getAuthMenuListApi = () => {
|
2024-11-01 16:27:04 +08:00
|
|
|
return http.get<Menu.MenuOptions[]>(`${rePrefix}/menu/list`, {}, { loading: false })
|
2024-11-04 09:58:00 +08:00
|
|
|
//return http.post<Menu.MenuOptions[]>(`/Register2`, {}, { loading: false })
|
2024-10-15 15:37:50 +08:00
|
|
|
}
|
|
|
|
|
// 获取按钮权限
|
|
|
|
|
export const getAuthButtonListApi = () => {
|
2024-11-01 16:27:04 +08:00
|
|
|
return http.get<Login.ResAuthButtons>(`${rePrefix}/auth/buttons`, {}, { loading: false })
|
2024-11-04 09:58:00 +08:00
|
|
|
//return http.post<Login.ResAuthButtons>(`/Register3`, {}, { loading: false })
|
2024-10-15 15:37:50 +08:00
|
|
|
}
|
|
|
|
|
// 用户退出登录
|
|
|
|
|
export const logoutApi = () => {
|
|
|
|
|
return http.post(`${rePrefix}/logout`)
|
2024-11-01 15:27:36 +08:00
|
|
|
}
|