fix(menu): 修复菜单列表接口参数缺失menuSource

- 不传递参数时后端默认为ruoyi菜单
This commit is contained in:
dubai
2026-01-11 18:41:53 +08:00
parent 18f253371b
commit a1210c1efd
4 changed files with 4 additions and 2 deletions

View File

@@ -54,4 +54,5 @@ export interface MenuQuery {
menuName?: string;
isShow?: boolean;
state?: boolean;
menuSource: number;
}

View File

@@ -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) => {

View File

@@ -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);

View File

@@ -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);