提交 8c1370b5 编写于 作者: rushui.chen's avatar rushui.chen

20191024 添加逻辑判断

上级 f78660ea
流水线 #16221 已失败 于阶段
in 0 second
......@@ -145,9 +145,16 @@ public class Test {
encryptTest4.setKey(keyResult4);
System.out.println(JSONObject.toJSONString(encryptTest4));
String privateKey="MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAJrqPdInBev+ksvBvo+rymL1K0+r5a+bq+74tZAHWE2oKVaTSNCbkacXoqPRpzaCqCwyy61zeGExppfZBm8tf6AVAcL+58YF0Fuk+0N4ZaxAi2wx//GqqWQs+Rzt5VPJ+yaulAzsEb0tW9o9Vc9VRxl8k0Fpi5Hj5J/pmLZrIj+FAgMBAAECgYAj+0A8rZ+sfsat2ORgDnDFp1hV+wEwVqIKsW3KdEpIT0S6vR7uhRPBkbXPAwUpnhNdoLa6JNXTDWs6XcgmzpSTx32WS3450+h1QNdLL+doiEinWxGijvp+UN7CadoeFBnLml3gGjPpTMeDheialQExwwvVKKe4+0VjO4zPDGnrAQJBAM3luGYrweNcFxvVsfQG6cpR/C0DeykyojN0Kbq+3/S+wG1y53Ak1HKz4OHftC4liYNXWy9W1fQ/MSbdVaSka+UCQQDAnJmYwmJ64I35T+GmgA0r505BCuYZG9pNyrjdko7n5+DaalRWSXuAwXb2SJbFHvWmVEgZOnVRhPdFgZUGP4shAkAjmG1SrInuhoMwOrdzGqbcZWQVXB60tp44CwMT19/b7gZSZaUBTDy2P8bHBeeeerrVTArlmjuO6EXVFDq0JgDJAkBLlCdhHcVu2fZbwdCVeOGyPI0kUJaBe8BpjgaESyHwNbixe8+kHCluGHwJn+opZ0CVB7VS0PGAD2DH0VUcooqBAkEAvLBZTnNcM/I2xbV6euw9gpEw7uLkT/94McLQOuZjKPWPHKDQOqa+y+CRPYuxIhQsFKmlTze7cR+/4QUANvGAow==";
System.out.println("解密");
String key="P1HsmTIiNj1n4b06vjaOCyZOHlk68rm/MVfIKZDz14ZCFhsyDbMDvyK4BYvbSo96IWPyhf77zaWgV0irnK7qCgPaos8kR77O/z+cqaorSdTX5ltLblkKwphxaao1OOUJg+x1XM9rKkCa6DoBKBBILyRFHuL5jAscB4Sxy8jsJ5A=";
String decrypt = RSAUtil.decrypt(key, privateKey);
System.out.println(decrypt);
String contentResult5 = AESUtil.aesDecrypt("MegB6ULLKg0VAJCOFnFet/4uNSEZlr+8130oaHPIn5IAmUWDstPOHOai6eIov5fFECCNF9thzzUxcdDGwsF8DM0GRSieto6rjhaJuOJl4IUoOTq6ouLruPFRe85ygUOm", decrypt);
System.out.println(contentResult5);
}
......
......@@ -39,23 +39,27 @@ public class PasswordServiceImpl implements PasswordService {
@Transactional
public void modifyPassword(Integer acctId, String oldPwd, String pwd) {
AccountInfoEntity entity = accountInfoDetailMapper.selectByPrimaryKey(acctId);
if (entity.getPassword().equals(oldPwd)) {
Date currentTime = new Date();
AccountInfoEntity accountInfoEntity = new AccountInfoEntity();
accountInfoEntity.setId(acctId);
accountInfoEntity.setModifiedId(acctId);
accountInfoEntity.setModifiedTime(currentTime);
accountInfoEntity.setPassword(pwd);
accountInfoDetailMapper.updatePasswordByPrimaryKey(accountInfoEntity);
if (doubleWritingMode) {
processDoubleWrite(acctId, pwd);
if (entity != null) {
if (entity.getPassword().equals(oldPwd)) {
Date currentTime = new Date();
AccountInfoEntity accountInfoEntity = new AccountInfoEntity();
accountInfoEntity.setId(acctId);
accountInfoEntity.setModifiedId(acctId);
accountInfoEntity.setModifiedTime(currentTime);
accountInfoEntity.setPassword(pwd);
accountInfoDetailMapper.updatePasswordByPrimaryKey(accountInfoEntity);
if (doubleWritingMode) {
processDoubleWrite(acctId, pwd);
}
//密码修改日志
LogPWDModifyEntity logPWDModifyEntity = AccountLogEntityUtils.getLogPWDModifyEntity(acctId, entity.getMobilePhone(),
oldPwd, pwd, AccountTypeEnum.LOG_TYPE_PASSWORD.getCode());
picaLogUtils.info(logPWDModifyEntity);
} else {
throw new AccountException(AccountExceptionEnum.PICA_PASSWORD_ERROR);
}
//密码修改日志
LogPWDModifyEntity logPWDModifyEntity = AccountLogEntityUtils.getLogPWDModifyEntity(acctId, entity.getMobilePhone(),
oldPwd, pwd, AccountTypeEnum.LOG_TYPE_PASSWORD.getCode());
picaLogUtils.info(logPWDModifyEntity);
} else {
throw new AccountException(AccountExceptionEnum.PICA_PASSWORD_ERROR);
throw new AccountException(AccountExceptionEnum.PICA_NOT_EXIST);
}
}
......
......@@ -24,7 +24,7 @@ import java.util.Map;
public class RSAUtil {
private static Map<Integer, String> keyMap = new HashMap<>();
private static String rsaprivatekey;
public static String rsaprivatekey;
public static String rsapublickey;
......@@ -123,7 +123,7 @@ public class RSAUtil {
public static void main(String[] args) throws Exception {
//生成公钥和私钥
//genKeyPair();
// genKeyPair();
// keyMap.put(0, publicKey);
// keyMap.put(1, privateKey);
// //加密字符串
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册