serv\web-侧边栏 标签统一
This commit is contained in:
@@ -68,8 +68,8 @@
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { ElButton, ElInput, ElTable, ElTableColumn, ElTag, ElPagination, ElMessage } from 'element-plus';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { resourceApi, resourceCategoryApi } from '@/apis/resource'
|
||||
import type { PageParam, ResourceSearchParams, Resource, ResourceCategory } from '@/types';
|
||||
import { resourceApi, resourceTagApi } from '@/apis/resource'
|
||||
import type { PageParam, ResourceSearchParams, Resource, Tag } from '@/types';
|
||||
import { ArticleShowView } from '@/views/article';
|
||||
import { ArticleStatus } from '@/types/enums';
|
||||
|
||||
@@ -86,7 +86,7 @@ const total = ref<number>(0);
|
||||
const articles = ref<Resource[]>([]);
|
||||
const showViewDialog = ref(false);
|
||||
const currentArticle = ref<any>(null);
|
||||
const categoryList = ref<ResourceCategory[]>([]);
|
||||
const categoryList = ref<Tag[]>([]); // 改为使用Tag类型(tagType=1表示文章分类)
|
||||
|
||||
onMounted(() => {
|
||||
loadArticles();
|
||||
@@ -95,7 +95,8 @@ onMounted(() => {
|
||||
|
||||
async function loadCategories() {
|
||||
try {
|
||||
const res = await resourceCategoryApi.getCategoryList();
|
||||
// 使用新的标签API获取文章分类标签(tagType=1)
|
||||
const res = await resourceTagApi.getTagsByType(1); // 1 = 文章分类标签
|
||||
if (res.success && res.dataList) {
|
||||
categoryList.value = res.dataList;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user