You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
971 B
48 lines
971 B
import { defHttp } from '/@/utils/http/axios';
|
|
import {
|
|
LoginParams,
|
|
LoginResultModel,
|
|
GetUserInfoByUserIdParams,
|
|
GetUserInfoByUserIdModel,
|
|
} from './model/userModel';
|
|
|
|
enum Api {
|
|
Login = '/login',
|
|
GetUserInfoById = '/getUserInfoById',
|
|
GetPermCodeByUserId = '/getPermCodeByUserId',
|
|
}
|
|
|
|
/**
|
|
* @description: user login api
|
|
*/
|
|
export function loginApi(params: LoginParams) {
|
|
return defHttp.request<LoginResultModel>(
|
|
{
|
|
url: Api.Login,
|
|
method: 'POST',
|
|
params,
|
|
},
|
|
{
|
|
errorMessageMode: 'modal',
|
|
}
|
|
);
|
|
}
|
|
|
|
/**
|
|
* @description: getUserInfoById
|
|
*/
|
|
export function getUserInfoById(params: GetUserInfoByUserIdParams) {
|
|
return defHttp.request<GetUserInfoByUserIdModel>({
|
|
url: Api.GetUserInfoById,
|
|
method: 'GET',
|
|
params,
|
|
});
|
|
}
|
|
|
|
export function getPermCodeByUserId(params: GetUserInfoByUserIdParams) {
|
|
return defHttp.request<string[]>({
|
|
url: Api.GetPermCodeByUserId,
|
|
method: 'GET',
|
|
params,
|
|
});
|
|
}
|
|
|