Browse Source

去掉时间戳校验

master
刘忱 1 day ago
parent
commit
47c5abd062
  1. 10
      win-admin/src/main/java/com/win/web/controller/base/CommandController.java
  2. 10
      win-admin/src/main/java/com/win/web/controller/base/ShellController.java

10
win-admin/src/main/java/com/win/web/controller/base/CommandController.java

@ -62,12 +62,12 @@ public class CommandController {
} }
String tmp = interfaceName + body + "Wenyin@2024" + timestamp; String tmp = interfaceName + body + "Wenyin@2024" + timestamp;
String computeSign = DigestUtils.md5DigestAsHex(tmp.getBytes()); String computeSign = DigestUtils.md5DigestAsHex(tmp.getBytes());
long tenTimestamp = timestamp + (10 * 60 * 1000); // 计算10分钟后的时间戳 //long tenTimestamp = timestamp + (10 * 60 * 1000); // 计算10分钟后的时间戳
long currentTimestamp = System.currentTimeMillis(); // 获取当前时间戳 //long currentTimestamp = System.currentTimeMillis(); // 获取当前时间戳
//过期 //过期
if(tenTimestamp < currentTimestamp) { //if(tenTimestamp < currentTimestamp) {
return AjaxResult.error(HttpStatus.EXPIRE_ERROR, "请求已过期"); // return AjaxResult.error(HttpStatus.EXPIRE_ERROR, "请求已过期");
} //}
List<String> activeProfile = ProfileUtil.getActiveProfile(); List<String> activeProfile = ProfileUtil.getActiveProfile();
//dev环境不校验签名 //dev环境不校验签名
if(/*!activeProfile.contains("dev") && */!StringUtils.equals(sign, computeSign.toUpperCase())) { if(/*!activeProfile.contains("dev") && */!StringUtils.equals(sign, computeSign.toUpperCase())) {

10
win-admin/src/main/java/com/win/web/controller/base/ShellController.java

@ -63,12 +63,12 @@ public class ShellController {
} }
String tmp = interfaceName + body + "Wenyin@2024" + timestamp; String tmp = interfaceName + body + "Wenyin@2024" + timestamp;
String computeSign = DigestUtils.md5DigestAsHex(tmp.getBytes()); String computeSign = DigestUtils.md5DigestAsHex(tmp.getBytes());
long tenTimestamp = timestamp + (10 * 60 * 1000); // 计算10分钟后的时间戳 //long tenTimestamp = timestamp + (10 * 60 * 1000); // 计算10分钟后的时间戳
long currentTimestamp = System.currentTimeMillis(); // 获取当前时间戳 //long currentTimestamp = System.currentTimeMillis(); // 获取当前时间戳
//过期 //过期
if(tenTimestamp < currentTimestamp) { //if(tenTimestamp < currentTimestamp) {
return AjaxResult.error(HttpStatus.EXPIRE_ERROR, "请求已过期"); // return AjaxResult.error(HttpStatus.EXPIRE_ERROR, "请求已过期");
} //}
List<String> activeProfile = ProfileUtil.getActiveProfile(); List<String> activeProfile = ProfileUtil.getActiveProfile();
//dev环境不校验签名 //dev环境不校验签名
if(/*!activeProfile.contains("dev") && */!StringUtils.equals(sign, computeSign.toUpperCase())) { if(/*!activeProfile.contains("dev") && */!StringUtils.equals(sign, computeSign.toUpperCase())) {

Loading…
Cancel
Save