修复数据库参数类型错误

This commit is contained in:
李志强 2026-01-30 16:29:49 +08:00
parent df0507ed2f
commit 0ecb832bce

View File

@ -272,16 +272,25 @@ async function handleLogout() {
async function loadModules() {
try {
const res = await getModulesList();
console.log('模块列表接口返回:', res);
if (res.code === 200) {
const list = res.data?.list || [];
moduleList.value = list
console.log('原始列表数据:', list);
const filteredList = list
.filter((item: ModuleItem) => item.status === 1 && item.is_show === 1)
.sort((a, b) => Number(a.sort) - Number(b.sort))
.map((item: ModuleItem) => ({
...item,
type: item.type || 0, // 0
title: item.name // title
}));
.sort((a, b) => Number(a.sort) - Number(b.sort));
console.log('过滤后列表:', filteredList);
moduleList.value = filteredList
.map((item: ModuleItem) => {
const mapped = {
...item,
type: item.type ?? 0, // 0
title: item.name // title
};
console.log('映射后模块:', mapped);
return mapped;
});
console.log('最终moduleList:', moduleList.value);
}
} catch (error) {
console.error("加载模块列表失败:", error);