Commit d57b1d83 authored by 陈勇's avatar 陈勇

文件不存在时,就不显示图标

parent 6a1b6bf0
...@@ -122,7 +122,14 @@ public class SettingController extends Controller { ...@@ -122,7 +122,14 @@ public class SettingController extends Controller {
public void logoUrl() { public void logoUrl() {
String filePath = String filePath =
PathKit.getRootClassPath()+ File.separator + "logo.png"; PathKit.getRootClassPath()+ File.separator + "logo.png";
this.renderJson(Ret.ok("logoUrl", ImageToBase64(filePath))); /**chenyong 20201218 文件不存在时,就不显示图标**/
File file=new File(filePath);
if(file.exists()) {
this.renderJson(Ret.ok("logoUrl", ImageToBase64(filePath)));
}else {
this.renderJson(Ret.fail("logoUrl", ImageToBase64("")));
}
} }
private static String ImageToBase64(String imgPath) { private static String ImageToBase64(String imgPath) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment