/*
|
* @Description: 菜单Api相关
|
* @Author: Ben Lin
|
* @version:
|
* @Date: 2024-06-18 15:09:47
|
* @LastEditors: Ben Lin
|
* @LastEditTime: 2024-06-21 16:50:45
|
*/
|
import { defHttp } from '/@/utils/http/axios';
|
import { getMenuListResultModel } from './model/menuModel';
|
import { genAction, Api } from '../tigerapi/system';
|
|
enum _Api {
|
GetMenuList = '/SYS/getMenuList',
|
GetMenuListAll = '/SYS/getMenuListAll',
|
}
|
|
/**
|
* @description: Get user menu based on userid
|
*/
|
|
export const getMenuList = (userid: {}) => {
|
return defHttp.get<getMenuListResultModel>(
|
{ url: _Api.GetMenuList, params: userid },
|
{
|
isTransformResponse: false, //api返回不做转换格式,保留原来数据
|
},
|
);
|
};
|
|
export const getMenuListAll = () => {
|
return defHttp.get<getMenuListResultModel>(
|
{ url: _Api.GetMenuListAll },
|
{
|
isTransformResponse: false, //api返回不做转换格式,保留原来数据
|
},
|
);
|
};
|
|
/**
|
* @description: 菜单权限
|
* @param {string} params
|
* @return {*}
|
*/
|
export const getMenuAuthList = async (params: string) => {
|
const usParams = genAction('V_USER_MENU', {
|
QueryAble_T: '',
|
where: "USER_ID = '" + params + "'",
|
order: '',
|
});
|
return await defHttp.post(
|
{ url: Api.QueryUrl, params: usParams },
|
{
|
errorMessageMode: 'none',
|
isTransformResponse: false,
|
},
|
);
|
};
|
|
/**
|
* @description: 获取菜单下的按钮
|
* @param {string} params
|
* @return {*}
|
*/
|
export const getMenuButtons = async (params: string) =>{
|
const usParams = genAction('SYS_MENU', {
|
QueryAble_T: '',
|
where: "PFUNC_CODE = '" + params + "'",
|
order: '',
|
});
|
return await defHttp.post(
|
{ url: Api.QueryUrl, params: usParams },
|
{
|
errorMessageMode: 'none',
|
isTransformResponse: false,
|
},
|
);
|
};
|