25 lines
677 B
TypeScript
25 lines
677 B
TypeScript
import request from '@/axios'
|
|
import type { UserType } from './types'
|
|
|
|
interface RoleParams {
|
|
roleName: string
|
|
}
|
|
|
|
export const loginApi = (data: UserType): Promise<IResponse<UserType>> => {
|
|
return request.post({ url: '/mock/user/login', data })
|
|
}
|
|
|
|
export const loginOutApi = (): Promise<IResponse> => {
|
|
return request.get({ url: '/mock/user/loginOut' })
|
|
}
|
|
|
|
export const getAdminRoleApi = (
|
|
params: RoleParams
|
|
): Promise<IResponse<AppCustomRouteRecordRaw[]>> => {
|
|
return request.get({ url: '/mock/role/list', params })
|
|
}
|
|
|
|
export const getTestRoleApi = (params: RoleParams): Promise<IResponse<string[]>> => {
|
|
return request.get({ url: '/mock/role/list2', params })
|
|
}
|