60 lines
1.8 KiB
TypeScript
60 lines
1.8 KiB
TypeScript
import type {Login} from '@/api/user/interface/user'
|
|
import {ADMIN as rePrefix} from '@/api/system/config/serviceName'
|
|
import http from '@/api'
|
|
import type {Dict} from '@/api/interface'
|
|
|
|
/**
|
|
* @name 登录模块
|
|
*/
|
|
// 用户登录
|
|
export const loginApi = (params: { username: string; password: string}) => {
|
|
return http.post<Login.ResLogin>(`${rePrefix}/login`, params, {loading: false})
|
|
// return http.post<Login.ResLogin>(`/Register1`, params, { loading: false })
|
|
}
|
|
// 获取菜单列表
|
|
export const getAuthMenuListApi = () => {
|
|
return http.get<Menu.MenuOptions[]>(`/sysFunction/getMenu`, {}, {loading: false})
|
|
// return http.post<Menu.MenuOptions[]>(`/Register2`, {}, { loading: false })
|
|
}
|
|
// 获取按钮权限
|
|
export const getAuthButtonListApi = () => {
|
|
return http.get<Login.ResAuthButtons>(`/sysFunction/getButton`, {}, {loading: false})
|
|
// return http.post<Login.ResAuthButtons>(`/Register3`, {}, { loading: false })
|
|
}
|
|
// 用户退出登录
|
|
export const logoutApi = () => {
|
|
return http.post(`${rePrefix}/logout`)
|
|
}
|
|
|
|
//获取下拉框列表
|
|
export const getDictList = () => {
|
|
return http.get<Dict>('/dictData/dictDataCache')
|
|
}
|
|
|
|
//token刷新
|
|
export const refreshToken = () => {
|
|
return http.get<Login.ResLogin>(`${rePrefix}/refreshToken`,
|
|
{},
|
|
{loading: false}
|
|
)
|
|
}
|
|
|
|
//获取场景
|
|
export const getCurrentScene = () => {
|
|
return http.get('/sysTestConfig/getCurrentScene', {}, {loading: false})
|
|
}
|
|
|
|
/**
|
|
* 获取RSA公钥
|
|
*/
|
|
export const getPublicKey = (username: string) => {
|
|
return http.get(`/admin/getPublicKey?username=${username}`, {}, {loading: false})
|
|
}
|
|
|
|
/**
|
|
* 获取是否在检测中自动生成报告
|
|
*/
|
|
export const getAutoGenerate = () => {
|
|
return http.get('/sysTestConfig/getAutoGenerate', {}, {loading: false})
|
|
}
|