diff --git a/f/web-kboss/src/views/homePage/ncmatch/mainPage/index.vue b/f/web-kboss/src/views/homePage/ncmatch/mainPage/index.vue index 173e22e..c7a37d3 100644 --- a/f/web-kboss/src/views/homePage/ncmatch/mainPage/index.vue +++ b/f/web-kboss/src/views/homePage/ncmatch/mainPage/index.vue @@ -177,14 +177,26 @@ export default Vue.extend({ const hasAuditInfo = Array.isArray(dataList) && dataList.length !== 0 const roles = sessionStorage.getItem('jueseNew') const isCustomer = roles ? roles.includes('客户') : true - if(res.data.data[0].audit_status==='pending') { - this.$message.warning('您的审核状态为待审核,请等待审核通过后发布~') - } else if (hasAuditInfo || !isCustomer) { + + // 安全检查:确保 data[0] 存在 + if (hasAuditInfo && dataList[0]) { + const auditStatus = dataList[0].audit_status + + if (auditStatus === 'pending') { + this.$message.warning('您的审核状态为待审核,请等待审核通过后发布~') + } else if (auditStatus === 'rejected') { + this.$message.warning('您的审核状态为驳回,请重新提交~') + } else { + // 审核通过或其他状态,允许发布 + this.publish_type = type + this.sendProductVisible = true + } + } else if (!isCustomer) { + // 非客户角色,允许发布 this.publish_type = type this.sendProductVisible = true - } else if(res.data.data[0].audit_status==='rejected') { - this.$message.warning('您的审核状态为驳回,请重新提交~') } else { + // 没有审核信息且是客户角色,显示提示 this.showTip = true } }) diff --git a/f/web-kboss/src/views/homePage/ncmatch/supplyAndDemandSquare/index.vue b/f/web-kboss/src/views/homePage/ncmatch/supplyAndDemandSquare/index.vue index 5886272..90c0c7f 100644 --- a/f/web-kboss/src/views/homePage/ncmatch/supplyAndDemandSquare/index.vue +++ b/f/web-kboss/src/views/homePage/ncmatch/supplyAndDemandSquare/index.vue @@ -43,6 +43,16 @@ +