|
@@ -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]);
|