fix(menu): 修复菜单列表接口参数缺失menuSource
- 不传递参数时后端默认为ruoyi菜单
This commit is contained in:
@@ -54,4 +54,5 @@ export interface MenuQuery {
|
||||
menuName?: string;
|
||||
isShow?: boolean;
|
||||
state?: boolean;
|
||||
menuSource: number;
|
||||
}
|
||||
|
||||
@@ -50,6 +50,7 @@ const gridOptions: VxeGridProps<Record<string, any>> = {
|
||||
query: async (_, formValues = {}) => {
|
||||
const resp = await menuList({
|
||||
...formValues,
|
||||
menuSource: 2 // 不传后端会默认为ruoyi的菜单
|
||||
});
|
||||
// 统一处理数据:确保 menuId 和 parentId 存在,并将根节点的 parentId 置为 null
|
||||
const items = (resp || []).map((item) => {
|
||||
|
||||
@@ -46,7 +46,7 @@ const [BasicForm, formApi] = useVbenForm({
|
||||
|
||||
async function setupMenuSelect() {
|
||||
// menu
|
||||
const menuArray = await menuList();
|
||||
const menuArray = await menuList({ menuSource: 2 }); // 不传后端会默认为ruoyi的菜单
|
||||
// support i18n
|
||||
menuArray.forEach((item) => {
|
||||
item.menuName = $t(item.menuName);
|
||||
|
||||
@@ -67,7 +67,7 @@ async function initTreeSelect(columns: Column[]) {
|
||||
* 加载菜单选择
|
||||
*/
|
||||
async function initMenuSelect() {
|
||||
const list = await menuList();
|
||||
const list = await menuList({ menuSource: 2 }); // 不传后端会默认为ruoyi的菜单
|
||||
// support i18n
|
||||
list.forEach((item) => {
|
||||
item.menuName = $t(item.menuName);
|
||||
|
||||
Reference in New Issue
Block a user