增加cate模块
This commit is contained in:
parent
0ecb832bce
commit
07b95be324
3
src/views/apps/cms/resoucres/category/index.vue
Normal file
3
src/views/apps/cms/resoucres/category/index.vue
Normal file
@ -0,0 +1,3 @@
|
||||
<template>这是cate</template>
|
||||
<script lang="ts" setup></script>
|
||||
<style lang="scss" scoped></style>
|
||||
3
src/views/apps/cms/resoucres/list/index.vue
Normal file
3
src/views/apps/cms/resoucres/list/index.vue
Normal file
@ -0,0 +1,3 @@
|
||||
<template>这是list</template>
|
||||
<script lang="ts" setup></script>
|
||||
<style lang="scss" scoped></style>
|
||||
@ -272,14 +272,11 @@ async function handleLogout() {
|
||||
async function loadModules() {
|
||||
try {
|
||||
const res = await getModulesList();
|
||||
console.log('模块列表接口返回:', res);
|
||||
if (res.code === 200) {
|
||||
const list = res.data?.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));
|
||||
console.log('过滤后列表:', filteredList);
|
||||
moduleList.value = filteredList
|
||||
.map((item: ModuleItem) => {
|
||||
const mapped = {
|
||||
@ -287,10 +284,8 @@ async function loadModules() {
|
||||
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