@jx3box/jx3box-common-ui 9.3.8 → 9.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jx3box/jx3box-common-ui",
3
- "version": "9.3.8",
3
+ "version": "9.3.9",
4
4
  "description": "JX3BOX UI",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -495,6 +495,7 @@ export default {
495
495
  },
496
496
  //获取收藏信息
497
497
  getCollectInfo() {
498
+ if(!this.drawerConfig.id && !this.drawerConfig.postType) return;
498
499
  getCollectList(this.drawerConfig.id, this.drawerConfig.postType).then(res => {
499
500
  this.collectInfo = res.data.data
500
501
  this.isCollect = this.collectInfo?.id > 0
@@ -569,31 +570,29 @@ export default {
569
570
  getSubscribeInfo() {
570
571
  let drawerConfig = this.drawerConfig
571
572
  // 作者相关接口
572
- if (drawerConfig.subscribeType === 'author') {
573
- getAuthorSubscribe(drawerConfig.author.author_id).then(res => {
573
+ if (drawerConfig.subscribeType === 'author' && drawerConfig.author.author_id) {
574
+ getSubscribeStatus(drawerConfig.author.author_id).then(res => {
574
575
  this.isSubscribe = res.data.data?.subscribed
575
576
  this.subscribeInfo = res.data.data
576
577
  })
577
578
  }
578
579
  //帖子
579
- if (drawerConfig.subscribeType === 'community') {
580
+ if (drawerConfig.subscribeType === 'community' && drawerConfig.id) {
580
581
  getSubscribePostStatus(drawerConfig.id).then(res => {
581
-
582
582
  this.isSubscribe = res.data.data?.subscribed
583
583
  this.subscribeInfo = res.data.data
584
584
  })
585
585
  }
586
586
  //文章
587
- if (drawerConfig.subscribeType === 'posts') {
587
+ if (drawerConfig.subscribeType === 'posts' && drawerConfig.id && drawerConfig.postType) {
588
588
  getSubscribeArticleStatus(drawerConfig.postType, drawerConfig.id).then(res => {
589
589
  this.isSubscribe = res.data.data?.subscribed
590
590
  this.subscribeInfo = res.data.data
591
591
  })
592
592
  }
593
593
  //百科
594
- if (drawerConfig.subscribeType === 'wiki') {
594
+ if (drawerConfig.subscribeType === 'wiki' && drawerConfig.id && drawerConfig.postType) {
595
595
  getSubscribeWikiStatus(drawerConfig.postType, drawerConfig.id).then(res => {
596
-
597
596
  this.isSubscribe = res.data.data?.subscribed
598
597
  this.subscribeInfo = res.data.data
599
598