修复数据库参数类型错误
This commit is contained in:
parent
df0507ed2f
commit
0ecb832bce
@ -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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user