You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
935 B
TypeScript
47 lines
935 B
TypeScript
3 years ago
|
import BasicService from './BasicService';
|
||
|
import config from '@/config';
|
||
|
|
||
|
/**
|
||
|
* @desc 菜单服务接口
|
||
|
*/
|
||
|
class MenuService extends BasicService {
|
||
|
constructor() {
|
||
|
super();
|
||
|
}
|
||
|
|
||
|
getAccountMenu = async () => {
|
||
|
return this.get(
|
||
|
`/gateway/idm/api/account/menus/${config.get('/app/code')}`,
|
||
|
);
|
||
|
};
|
||
|
|
||
|
/**
|
||
|
* 获取所有菜单信息
|
||
|
*/
|
||
|
query = async (searchKey?: string) => {
|
||
|
return this.get(`/gateway/idm/api/menus?searchKey=${searchKey}`);
|
||
|
};
|
||
|
|
||
|
queryByAppId = async (appId: string) => {
|
||
|
return this.get(`/gateway/idm/api/menus/${appId}/menu`);
|
||
|
};
|
||
|
|
||
|
/**
|
||
|
* 获取菜单信息
|
||
|
*/
|
||
|
getById = async (id: string) => {
|
||
|
return this.get(`/gateway/idm/api/menus/${id}`);
|
||
|
};
|
||
|
|
||
|
/**
|
||
|
* 获取菜单信息
|
||
|
*/
|
||
|
getChild = async (id: string) => {
|
||
|
return this.get(`/gateway/idm/api/menus/${id}/children`);
|
||
|
};
|
||
|
}
|
||
|
|
||
|
const menuService = new MenuService();
|
||
|
|
||
|
export default menuService;
|