👽 细节修改

pull/18/head
ruibaby 2018-06-03 22:30:55 +08:00
parent 210ae09f1e
commit 2bd40d3ec8
3 changed files with 19 additions and 16 deletions

View File

@ -10,6 +10,7 @@ import com.sun.syndication.io.FeedException;
import com.sun.syndication.io.WireFeedOutput;
import io.github.biezhi.ome.OhMyEmail;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.util.ResourceUtils;
import javax.imageio.ImageIO;
@ -23,7 +24,6 @@ import java.io.*;
import java.net.URI;
import java.net.URL;
import java.net.URLConnection;
import java.security.MessageDigest;
import java.text.SimpleDateFormat;
import java.time.Instant;
import java.time.ZoneId;
@ -121,6 +121,9 @@ public class HaloUtils {
Theme theme = null;
for (File file : files) {
if (file.isDirectory()) {
if (StringUtils.equals("__MACOSX", file.getName())) {
continue;
}
theme = new Theme();
theme.setThemeName(file.getName());
File optionsPath = new File(themesPath.getAbsolutePath(), file.getName() + "/module/options.ftl");
@ -134,7 +137,7 @@ public class HaloUtils {
}
}
}catch (Exception e){
log.error("主题获取失败:{0}",e.getMessage());
log.error("主题获取失败:", e.getMessage());
}
return themes;
}
@ -170,7 +173,7 @@ public class HaloUtils {
}
}
}catch (Exception e){
log.error("未知错误:{0}",e.getMessage());
log.error("未知错误:", e.getMessage());
}
return tpls;
}
@ -191,7 +194,7 @@ public class HaloUtils {
inputStream.close();
return new String(fileContent,"UTF-8");
}catch (Exception e){
log.error("读取模板文件错误:{0}",e.getMessage());
log.error("读取模板文件错误:", e.getMessage());
}
return null;
}

View File

@ -259,14 +259,14 @@ public class PostController extends BaseController{
* @return /admin/posts
*/
@GetMapping("/throw")
public String moveToTrash(@RequestParam("postId") Long postId){
public String moveToTrash(@RequestParam("postId") Long postId,@RequestParam("status") Integer status){
try{
postService.updatePostStatus(postId,2);
log.info("编号为"+postId+"的文章已被移到回收站");
}catch (Exception e){
log.error("未知错误:{0}",e.getMessage());
}
return "redirect:/admin/posts";
return "redirect:/admin/posts?status="+status;
}
/**

View File

@ -96,13 +96,13 @@
<#case 0>
<a href="/archives/${post.postUrl}" class="btn btn-primary btn-xs " target="_blank">查看</a>
<a href="/admin/posts/edit?postId=${post.postId?c}" class="btn btn-info btn-xs ">编辑</a>
<button class="btn btn-danger btn-xs " onclick="modelShow('/admin/posts/throw?postId=${post.postId?c}','确定移到回收站?')">丢弃</button>
<button class="btn btn-danger btn-xs " onclick="modelShow('/admin/posts/throw?postId=${post.postId?c}&status=0','确定移到回收站?')">丢弃</button>
<#break >
<#case 1>
<a href="/admin/posts/edit?postId=${post.postId?c}"
class="btn btn-info btn-xs ">编辑</a>
<button class="btn btn-primary btn-xs " onclick="modelShow('/admin/posts/revert?postId=${post.postId?c}&status=1','确定发布该文章?')">发布</button>
<button class="btn btn-danger btn-xs " onclick="modelShow('/admin/posts/throw?postId=${post.postId?c}','确定移到回收站?')">丢弃</button>
<button class="btn btn-danger btn-xs " onclick="modelShow('/admin/posts/throw?postId=${post.postId?c}&status=1','确定移到回收站?')">丢弃</button>
<#break >
<#case 2>
<a href="/admin/posts/revert?postId=${post.postId?c}&status=2" class="btn btn-primary btn-xs ">还原</a>