Skip to content

Commit aaec6ea

Browse files
committed
perf: article uri
1 parent 0200629 commit aaec6ea

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

blog-business-boot/src/main/java/com/hackyle/blog/business/service/impl/ArticleServiceImpl.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,9 @@ private void checkAndAdjustURI(ArticleAddDto articleAddDto) {
363363
uri = "/" + uri;
364364
}
365365

366+
//URI中如果有空格,替换为横线
367+
uri = uri.replaceAll(" ", "-");
368+
366369
//在URI前拼接文章分类的编码
367370
String categoryIds = articleAddDto.getCategoryIds();
368371
if(StringUtils.isNotBlank(categoryIds) && categoryIds.split(",").length >= 1) {
@@ -401,6 +404,9 @@ private void adjustURI(ArticleAddDto articleAddDto) {
401404
uri = "/" + uri;
402405
}
403406

407+
//URI中如果有空格,替换为横线
408+
uri = uri.replaceAll(" ", "-");
409+
404410
articleAddDto.setUri(uri);
405411
}
406412

blog-business-vue2/src/views/article/components/ArticleEditor.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
<el-col :span="12">
6363
<el-form-item label="Tags" prop="tagList">
6464
<!--<select-tags :initTags="articleDataForm.tags" @chooseTags="chooseTagHandler"/>-->
65-
<el-select v-model="articleDataForm.tags" placeholder="Please Select Tags"
65+
<el-select v-model="articleDataForm.tags" placeholder="Please select tags"
6666
:filterable="true" :multiple="true"
6767
style="width: 100%;" value-key="id">
6868
<!--NOTICE:v-model绑定的是一个对象,option里面也要绑定一个对象--->

0 commit comments

Comments
 (0)