修复MD5

pet
shanao 2024-10-23 17:24:25 +08:00
parent 87520d5b8f
commit 162b25bb87
3 changed files with 313 additions and 294 deletions

View File

@ -1,5 +1,6 @@
package com.zcloud.controller.app;
import cn.hutool.core.io.FileUtil;
import cn.hutool.crypto.digest.DigestUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
@ -552,7 +553,7 @@ public class AppHiddenController extends BaseController {
}
File tempFile = new File(file.getOriginalFilename());
FileUtils.copyInputStreamToFile(file.getInputStream(), tempFile);
String md5 = DigestUtil.md5Hex(tempFile);
String md5 = FileUtil.isEmpty(tempFile) ? "" : DigestUtil.md5Hex(tempFile);
if (!FileUpload.isImage(tempFile)) {
tempFile.delete();
map.put("result", "failed");

View File

@ -1,5 +1,6 @@
package com.zcloud.controller.app;
import cn.hutool.core.io.FileUtil;
import cn.hutool.crypto.digest.DigestUtil;
import com.zcloud.controller.base.BaseController;
import com.zcloud.entity.Page;
@ -36,7 +37,9 @@ public class AppImgFilesController extends BaseController {
@Autowired
private ImgFilesService imgfilesService;
/**
/**
*
*
* @param
* @throws Exception
*/
@ -64,8 +67,8 @@ public class AppImgFilesController extends BaseController {
MultipartFile file = files[i];
// 保存文件
File tempFile = new File(file.getOriginalFilename());
String md5 = DigestUtil.md5Hex(tempFile);
FileUtils.copyInputStreamToFile(file.getInputStream(), tempFile);
String md5 = FileUtil.isEmpty(tempFile) ? "" : DigestUtil.md5Hex(tempFile);
if (!FileUpload.isImage(tempFile) && !TYPE.equals("2") && !TYPE.equals("102")) {//四色图改为json文件,不用判断类型
tempFile.delete();
map.put("result", "failed");
@ -109,7 +112,9 @@ public class AppImgFilesController extends BaseController {
}
/**
/**
*
*
* @param
* @throws Exception
*/
@ -142,7 +147,9 @@ public class AppImgFilesController extends BaseController {
}
/**
/**
*
*
* @param
* @throws Exception
*/
@ -209,7 +216,9 @@ public class AppImgFilesController extends BaseController {
return map;
}
/**
/**
*
*
* @param out
* @throws Exception
*/
@ -228,7 +237,9 @@ public class AppImgFilesController extends BaseController {
return map;
}
/**
/**
*
*
* @param
* @throws Exception
*/
@ -245,7 +256,9 @@ public class AppImgFilesController extends BaseController {
return map;
}
/**
/**
*
*
* @param page
* @throws Exception
*/
@ -267,7 +280,9 @@ public class AppImgFilesController extends BaseController {
return map;
}
/**
/**
*
*
* @param
* @throws Exception
*/
@ -285,7 +300,9 @@ public class AppImgFilesController extends BaseController {
return map;
}
/**
/**
*
*
* @param
* @throws Exception
*/
@ -309,7 +326,9 @@ public class AppImgFilesController extends BaseController {
return map;
}
/**excel
/**
* excel
*
* @param
* @throws Exception
*/
@ -341,7 +360,9 @@ public class AppImgFilesController extends BaseController {
}
/**
/**
*
*
* @param
* @throws Exception
*/

View File

@ -153,7 +153,6 @@ public class LoginController extends BaseController {
} catch (AuthenticationException ae) {
errInfo = "usererror";
}
Integer port = SpringUtil.getApplicationContext().getEnvironment().getProperty("server.port", Integer.class);
if (subject.isAuthenticated()) { //验证是否登录成功
removeSession(USERNAME);
@ -178,8 +177,7 @@ public class LoginController extends BaseController {
if (backEndPath.get("result").toString().equals("success")) {
backEndPath.put("baseImgPath",map.get("baseImgPath").toString());
backEndPath.put("USER_IDENTITY",map.get("USER_IDENTITY").toString());
backEndPath.put("BACKENDADDR", "http://" + ip + ":" + port + "/");
backEndPath.put("BACKENDADDR", map.get("BACKENDADDR").toString());
System.out.println("登录返回参数:" + backEndPath);
return backEndPath;
} else {
@ -190,7 +188,6 @@ public class LoginController extends BaseController {
return map;
}
}
map.put("BACKENDADDR", "http://" + ip + ":" + port + "/");
if ("99".equals(pd.getString("STATUS"))) {
errInfo = "userlock";
map.put("result", "fail");