👽 修改标签为英文时不变小写,以及没有标签时不添加空格为一个标签。

pull/5/head
RYAN0UP_ 2018-04-29 12:27:19 +08:00
parent a79b3a9bd0
commit 2967569f32
2 changed files with 6 additions and 3 deletions

View File

@ -158,8 +158,10 @@ public class PostController extends BaseController{
post.setUser(user);
List<Category> categories = categoryService.strListToCateList(cateList);
post.setCategories(categories);
List<Tag> tags = tagService.strListToTagList(StringUtils.trim(tagList));
post.setTags(tags);
if(StringUtils.isNotEmpty(tagList)){
List<Tag> tags = tagService.strListToTagList(StringUtils.trim(tagList));
post.setTags(tags);
}
postService.saveByPost(post);
log.info("已发表新文章:"+post.getPostTitle());
logsService.saveByLogs(new Logs(LogsRecord.PUSH_POST,post.getPostTitle(),HaloUtil.getIpAddr(request),HaloUtil.getDate()));

View File

@ -151,7 +151,8 @@
$('#tagList').tagEditor({
//initialTags: ['Hello', 'World', 'Example', 'Tags'],
delimiter: ',',
placeholder: '请输入标签'
placeholder: '请输入标签',
forceLowercase: false
});
<#if post??>