|
@@ -32,7 +32,7 @@
|
|
|
<!--作品链接-->
|
|
<!--作品链接-->
|
|
|
<div class="app__dp_f app__f_r app__alig_c app__mt_20">
|
|
<div class="app__dp_f app__f_r app__alig_c app__mt_20">
|
|
|
<h5 class="app__f_s_0">作品链接</h5>
|
|
<h5 class="app__f_s_0">作品链接</h5>
|
|
|
- <el-input show-word-limit v-model="title" class="title _title" placeholder="例如:https://www.proginn.com 若无法添加作品有效链接,请添加作品截图" :maxlength="50"></el-input>
|
|
|
|
|
|
|
+ <el-input show-word-limit v-model="workUrl" class="title _title" placeholder="例如:https://www.proginn.com 若无法添加作品有效链接,请添加作品截图" :maxlength="50"></el-input>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
@@ -75,7 +75,8 @@
|
|
|
}
|
|
}
|
|
|
],
|
|
],
|
|
|
fileList: [],
|
|
fileList: [],
|
|
|
- uploading: false
|
|
|
|
|
|
|
+ uploading: false,
|
|
|
|
|
+ workUrl: ""
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
computed: {},
|
|
computed: {},
|
|
@@ -127,42 +128,41 @@
|
|
|
},
|
|
},
|
|
|
publish() {
|
|
publish() {
|
|
|
this.needVerify();
|
|
this.needVerify();
|
|
|
- if (!this.title) {
|
|
|
|
|
- this.$message.error("请输入文章标题");
|
|
|
|
|
|
|
+ if (!this.workName) {
|
|
|
|
|
+ this.$message.error("请输入项目名称");
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- if (this.title.length < 2) {
|
|
|
|
|
- this.$message.error("文章标题不可少于2字符");
|
|
|
|
|
|
|
+ if (this.workName.length < 2) {
|
|
|
|
|
+ this.$message.error("项目名称不可少于2字符");
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- if (this.title.length > 64) {
|
|
|
|
|
- this.$message.error("文章标题不可超过64字符,请删减");
|
|
|
|
|
|
|
+ if (this.title.length > 50) {
|
|
|
|
|
+ this.$message.error("文章标题不可超过50字符,请删减");
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (!this.content) {
|
|
if (!this.content) {
|
|
|
- this.$message.error("请输入文章正文");
|
|
|
|
|
|
|
+ this.$message.error("请输入项目正文");
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- if (this.content.length < 100) {
|
|
|
|
|
- this.$message.error("文章正文不可少于100字符");
|
|
|
|
|
|
|
+ if (this.content.length < 60) {
|
|
|
|
|
+ this.$message.error("项目正文不可少于60字符");
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- if (this.content.length > 100000) {
|
|
|
|
|
- this.$message.error("文章正文不可超过1万字符,请删减");
|
|
|
|
|
|
|
+ if (this.content.length > 10000) {
|
|
|
|
|
+ this.$message.error("项目正文不可大于10000字符,请删减");
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
const data = {
|
|
const data = {
|
|
|
- title: this.title,
|
|
|
|
|
- intro: this.subTitle,
|
|
|
|
|
- body: this.content,
|
|
|
|
|
- provider_id: this.collectionId,
|
|
|
|
|
- cover_url: this.cover_url
|
|
|
|
|
|
|
+ name: this.workName,
|
|
|
|
|
+ description: this.content,
|
|
|
|
|
+ url: this.workUrl,
|
|
|
|
|
+ image_list: this.cover_url,
|
|
|
};
|
|
};
|
|
|
if (this.topicId) {
|
|
if (this.topicId) {
|
|
|
data.topic_id = this.topicId;
|
|
data.topic_id = this.topicId;
|
|
|
this.$axios
|
|
this.$axios
|
|
|
- .$post(`/api/community/topic/update_topic`, data)
|
|
|
|
|
|
|
+ .$post(`/api/user_works/add`, data)
|
|
|
.then(res => {
|
|
.then(res => {
|
|
|
console.log(res);
|
|
console.log(res);
|
|
|
if (res.status === -99) {
|
|
if (res.status === -99) {
|
|
@@ -201,8 +201,8 @@
|
|
|
},
|
|
},
|
|
|
handleFileChange(file) {
|
|
handleFileChange(file) {
|
|
|
console.log(file);
|
|
console.log(file);
|
|
|
- if (file.size / 1024 > 500) {
|
|
|
|
|
- this.$message.error("图片大小不得超过500k,请重新选择");
|
|
|
|
|
|
|
+ if (file.size / 1024 > 2048) {
|
|
|
|
|
+ this.$message.error("图片大小不得超过2M,请重新选择");
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
const formData = new FormData();
|
|
const formData = new FormData();
|
|
@@ -231,7 +231,7 @@
|
|
|
this.workName = this.workName.replace(/[&|\*|#|\\]/g, "");
|
|
this.workName = this.workName.replace(/[&|\*|#|\\]/g, "");
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
- handleChange(e){
|
|
|
|
|
|
|
+ handleChange(e) {
|
|
|
console.log(e);
|
|
console.log(e);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|