mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-20 00:06:45 +08:00
添加动态事件
This commit is contained in:
@@ -142,8 +142,8 @@ export default {
|
||||
// let content= this.addForm.content.replace(/<.*?>/ig,"");
|
||||
// let content= this.addForm.content.replace(/[^\u4E00-\u9FA5|\d|\a-zA-Z|\r\n\s,.?!,。?!<>…—&$=()-+/*{}[\]]|\r\n\s/g,"");
|
||||
if(this.addForm.content.trim() == ''){
|
||||
this.$message('您输入的内容为空,无法发布')
|
||||
type: 'warning'
|
||||
this.$message.warning('您输入的内容为空,无法发布')
|
||||
// type: 'warning'
|
||||
this.loading=false
|
||||
return
|
||||
}
|
||||
@@ -156,6 +156,19 @@ export default {
|
||||
type:'success',
|
||||
message:"发布文章成功"
|
||||
});
|
||||
let event = {
|
||||
key: "PublishArticle",//后台的事件key 发布文章且审核通过
|
||||
title: "首次发表文章(审核通过)",//事件的标题
|
||||
parameters:"",//用户自定义参数 name:value,name:value
|
||||
content: this.addForm.title,//事件的内容
|
||||
objId: this.addForm.id,//关联的id
|
||||
objType: "2",//关联的类型
|
||||
objInfo: "文章",
|
||||
aid: this.userInfo.aid, //当前登录人的id
|
||||
aname: this.userInfo.name,//当前人的姓名
|
||||
status: 1 //状态,直接写1
|
||||
}
|
||||
this.$store.dispatch("userTrigger", event);
|
||||
}
|
||||
if(res.message.indexOf('审核')!=-1){
|
||||
this.$message(
|
||||
@@ -164,6 +177,7 @@ export default {
|
||||
message:"发布文章失败,因包含敏感词,请等待人工审核"
|
||||
});
|
||||
}
|
||||
|
||||
this.$emit("success",{result:res.result,status: this.addForm.status});
|
||||
if(!this.jumpLimit){
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user