|
|
|
@@ -1,11 +1,7 @@ |
|
|
|
package com.lecoo.kjg.web.sys.web;
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
import com.google.common.collect.Lists;
|
|
|
|
import com.jeesite.common.config.Global;
|
|
|
|
import com.jeesite.common.idgen.IdGen;
|
|
|
|
import com.jeesite.common.lang.ObjectUtils;
|
|
|
|
import com.jeesite.common.lang.StringUtils;
|
|
|
|
import com.jeesite.common.shiro.session.SessionManager;
|
|
|
|
import com.jeesite.modules.sys.service.OfficeService;
|
|
|
|
import com.lecoo.kjg.web.sys.dto.HistoryRecord;
|
|
|
|
@@ -18,16 +14,17 @@ import com.lecoo.kjg.web.sys.service.EmpService; |
|
|
|
import com.lecoo.kjg.web.sys.service.FaceHistoryService;
|
|
|
|
import com.lecoo.kjg.web.sys.service.PasswordLogService;
|
|
|
|
import com.lecoo.kjg.web.sys.utils.JasyptUtil;
|
|
|
|
import com.lecoo.kjg.web.sys.utils.StringUtils;
|
|
|
|
import com.lenovo.nowgo.common.constant.ResponseCode;
|
|
|
|
import com.lenovo.nowgo.common.http.response.MyResponse;
|
|
|
|
import org.jasypt.encryption.pbe.PooledPBEStringEncryptor;
|
|
|
|
import org.jasypt.encryption.pbe.config.SimpleStringPBEConfig;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
|
import org.springframework.util.DigestUtils;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
import java.io.UnsupportedEncodingException;
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.List;
|
|
|
|
@@ -227,6 +224,29 @@ public class ApiController extends BaseController { |
|
|
|
return outputData(0, cryptStr);
|
|
|
|
}
|
|
|
|
|
|
|
|
@PostMapping("/jasypt2")
|
|
|
|
@ResponseBody
|
|
|
|
public String jasypt22(@RequestParam("pwd") String pwd){
|
|
|
|
System.err.println("原密文:"+pwd);
|
|
|
|
pwd = StringUtils.fullWidth2halfWidth(pwd);//解决#等特殊字符传过来变成全角的问题
|
|
|
|
System.err.println("原密文:"+pwd);
|
|
|
|
String cryptStr = JasyptUtil.encrypt(pwd);
|
|
|
|
System.err.println("加密文:"+cryptStr);
|
|
|
|
return cryptStr;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/jasyptDecrypt2")
|
|
|
|
@ResponseBody
|
|
|
|
public String jasyptDecrypt2(@RequestParam("str") String str){
|
|
|
|
System.err.println("加密文1:"+str);
|
|
|
|
str = StringUtils.fullWidth2halfWidth(str);
|
|
|
|
System.err.println("加密文2:"+str);
|
|
|
|
String pwdStr = JasyptUtil.decrypt(str);
|
|
|
|
System.err.println("解密文:"+pwdStr);
|
|
|
|
return pwdStr;
|
|
|
|
}
|
|
|
|
|
|
|
|
@GetMapping("/jasyptDecrypt")
|
|
|
|
@ResponseBody
|
|
|
|
public MyResponse jasyptDecrypt(@RequestParam(required = true) String cryptStr){
|
|
|
|
@@ -236,4 +256,5 @@ public class ApiController extends BaseController { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|