From 5a157ef70b6c011066464b5741835a370327c95e Mon Sep 17 00:00:00 2001 From: daihh Date: Sat, 22 Oct 2022 14:32:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E5=AF=B9U=E5=B8=81=E5=A4=84?= =?UTF-8?q?=E7=90=86=E7=9A=84=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Portal/interactBar.vue | 55 ++++++++++++++------------- src/views/article/ManageList.vue | 44 +++++---------------- src/views/course/ManageList.vue | 47 +++++++++-------------- src/views/portal/qa/Answer.vue | 38 ++++++++++-------- 4 files changed, 79 insertions(+), 105 deletions(-) diff --git a/src/components/Portal/interactBar.vue b/src/components/Portal/interactBar.vue index d3848d08..f064c8b7 100644 --- a/src/components/Portal/interactBar.vue +++ b/src/components/Portal/interactBar.vue @@ -347,21 +347,22 @@ export default { if(this.unicom) { this.$store.dispatch("unicomPraises",false) } - - let event = { - key: "cancelPraise",// - title: "取消点赞",//事件的标题 - parameters:"author:"+this.data.sysCreateAid,//用户自定义参数 name:value,name:value - content: "取消点赞"+postData.title,//事件的内容 - objId: this.data.id,//关联的id - objType: this.type,//关联的类型 - objInfo: this.data.title, - aid: this.userInfo.aid, //当前登录人的id - aname: this.userInfo.name,//当前人的姓名 - status: 1 //状态,直接写1 + //自己给自己点赞不算 + if(this.userInfo.aid!=this.data.sysCreateAid){ + let event = { + key: "CancelPraise",// + title: "取消点赞",//事件的标题 + parameters:"author:"+this.data.sysCreateAid,//用户自定义参数 name:value,name:value + content: "取消点赞"+postData.title,//事件的内容 + objId: this.data.id,//关联的id + objType: this.type,//关联的类型 + objInfo: this.data.title, + aid: this.userInfo.aid, //当前登录人的id + aname: this.userInfo.name,//当前人的姓名 + status: 1 //状态,直接写1 + } + this.$store.dispatch("userTrigger", event); } - this.$store.dispatch("userTrigger", event); - this.$message({message:'取消点赞',type:'success'}) }else{ console.log('取消失败:'+res.message); @@ -385,19 +386,21 @@ export default { // } this.isPraise=true; this.$message({message:'点赞成功',type:'success'}) - let event = { - key: "Praise",//后台的事件key 发布文章且审核通过 - title: "点赞",//事件的标题 - parameters:"author:"+this.data.sysCreateAid,//用户自定义参数 name:value,name:value - content: "点赞"+postData.title,//事件的内容 - objId: this.data.id,//关联的id - objType: this.type,//关联的类型 - objInfo: this.data.title, - aid: this.userInfo.aid, //当前登录人的id - aname: this.userInfo.name,//当前人的姓名 - status: 1 //状态,直接写1 + if(this.userInfo.aid!=this.data.sysCreateAid){ + let event = { + key: "Praise",//后台的事件key 发布文章且审核通过 + title: "点赞",//事件的标题 + parameters:"author:"+this.data.sysCreateAid,//用户自定义参数 name:value,name:value + content: "点赞"+postData.title,//事件的内容 + objId: this.data.id,//关联的id + objType: this.type,//关联的类型 + objInfo: this.data.title, + aid: this.userInfo.aid, //当前登录人的id + aname: this.userInfo.name,//当前人的姓名 + status: 1 //状态,直接写1 + } + this.$store.dispatch("userTrigger", event); } - this.$store.dispatch("userTrigger", event); }else{ console.log('点赞失败:'+res.message); } diff --git a/src/views/article/ManageList.vue b/src/views/article/ManageList.vue index f59be91f..386b4ac5 100644 --- a/src/views/article/ManageList.vue +++ b/src/views/article/ManageList.vue @@ -1,23 +1,9 @@