Browse Source

增加路由参数taxonomy适配支持期刊类型
修改BUG查询成功后没有数据,meta报错问题,增加结果大于0的的检查

zhy 1 month ago
parent
commit
afe39b2d8e
1 changed files with 3 additions and 3 deletions
  1. 3 3
      src/views/cms/post.vue

+ 3 - 3
src/views/cms/post.vue

@@ -108,15 +108,15 @@ export default {
     },
     // 所有栏目查询
     async getCatalogs() {
-      const res = await cmsQuery({ paging: false }, 'catalog');
+      const res = await cmsQuery({ paging: false }, this.$route.query.taxonomy ?? 'catalog');
       if (res.code == 200) this.mydata.catalog = res.rows;
     },
     // 查询分类栏目
     async getCatalog() {
       this.mydata.loading = true;
-      const res = await cmsQuery({ paging: false, type: this.mydata.type }, 'catalog');
+      const res = await cmsQuery({ paging: false, type: this.mydata.type }, this.$route.query.taxonomy ?? 'catalog');
       if (res.code == 200) this.mydata.catalog = res.rows;
-      if (res.code == 200) {
+      if (res.code == 200 && res.rows.length > 0) {
         this.$set(this.mydata, 'treeData', this.handleTree(res.rows, 'termId'))
         if (this.mydata.treeData[0]) this.mydata.alias = this.mydata.treeData[0].alias;
         this.nodeClick(this.mydata.treeData[0]);