mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-09 19:06:43 +08:00
发布文章空格处理
This commit is contained in:
@@ -89,6 +89,8 @@ export default {
|
|||||||
apiArticle.detail(id,false).then(res => {
|
apiArticle.detail(id,false).then(res => {
|
||||||
if (res.status == 200) {
|
if (res.status == 200) {
|
||||||
this.addForm = res.result;
|
this.addForm = res.result;
|
||||||
|
// this.addForm.content = res.result.content.trim();
|
||||||
|
// console.log(this.addForm.content)
|
||||||
if(this.addForm.coverurl){
|
if(this.addForm.coverurl){
|
||||||
this.converImage = this.fileBaseUrl + this.addForm.coverurl;
|
this.converImage = this.fileBaseUrl + this.addForm.coverurl;
|
||||||
}
|
}
|
||||||
@@ -137,6 +139,15 @@ export default {
|
|||||||
}
|
}
|
||||||
this.loading=true;
|
this.loading=true;
|
||||||
this.addForm.status = 2;
|
this.addForm.status = 2;
|
||||||
|
let content= this.addForm.content.replace(/<.*?>/ig,"");
|
||||||
|
console.log(content)
|
||||||
|
if(content.trim() == ''){
|
||||||
|
this.$message('您输入的内容为空,无法发布')
|
||||||
|
type: 'warning'
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.addForm.content=content.trim()
|
||||||
|
console.log(this.addForm.content,'iguighui')
|
||||||
apiArticle.save(this.addForm).then(res => {
|
apiArticle.save(this.addForm).then(res => {
|
||||||
if (res.status == 200) {
|
if (res.status == 200) {
|
||||||
if(res.message=='服务处理成功'){
|
if(res.message=='服务处理成功'){
|
||||||
|
|||||||
@@ -322,7 +322,6 @@ export default {
|
|||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
if(this.searchTags.length == 0){
|
if(this.searchTags.length == 0){
|
||||||
console.log('gyigyu')
|
|
||||||
this.queryCondition.majorType = null;
|
this.queryCondition.majorType = null;
|
||||||
this.queryCondition.orgDomain = null;
|
this.queryCondition.orgDomain = null;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user