This commit is contained in:
sxu 2025-02-02 18:38:21 +08:00
parent 23e15ad00d
commit bd52203d90
4 changed files with 15 additions and 11 deletions

View File

@ -57,8 +57,10 @@ public class AesEncryptUtil {
}
public static void main(String[] args) {
System.out.println(aesEncrypt("123"));
System.out.println(aesDecode("Ko0muw9mxpn4mKcd40W0gw=="));
//System.out.println(aesDecode("$2a$10$WoMFC/Qwh/fgVeJoywyqZ.ua6OFU8wxdzaZj4SM14PYa6GimETwMe"));
System.out.println(aesEncrypt("Bonus$2026"));
System.out.println(aesDecode("PCAGz8j5ByU2AzoT6vtlLA=="));
System.out.println(aesEncrypt("18110922397"));
System.out.println(aesDecode("poEWO1yyC/EaUR9vmrrNSA=="));
System.out.println(aesDecode("poEWO1yyC/EaUR9vmrrNSA=="));
}
}

View File

@ -65,6 +65,7 @@ public class SM4EncryptUtils {
}
public static void main(String[] args) {
System.out.println(sm4Decrypt("H6INNw7emp3/5pYtE6O7kg==##encrypted"));
System.out.println(sm4Encrypt("18110922397"));
System.out.println(sm4Decrypt("J1KE3IyZqIqgWk09Z2gWpQ==##encrypted"));
}
}

View File

@ -109,7 +109,8 @@ public class TokenController {
return R.fail("当前系统用户并发数超过系统配置,请稍后再试");
}
CustInfoAppIdLoginVO loginUser = custLogin(form);
return R.ok(tokenService.createToken(loginUser));
//return R.ok(tokenService.createToken(loginUser));
return R.ok(loginUser);
}
private CustInfoAppIdLoginVO custLogin(LoginBody content) {
@ -157,9 +158,8 @@ public class TokenController {
}
public static void main(String[] args) {
boolean flag = encoder.matches("abc", "$2a$10$UMNFdXSz5S1NQSDXv/B4L.iCTppSO1FFE4g6c4Mab.Z7VPWvGcLwG");
String encodedStr = encoder.encode("abc");
System.out.println(encodedStr);
System.out.println(encoder.encode("Bonus$2026"));
boolean flag = encoder.matches("Bonus$2026", "$2a$10$vrcmG0TyvgH5tS9g8ptaVOK2K3pYWVAa13SWEK7pQBGRtNAPlGV7O");
System.out.println(flag);
}
@ -170,7 +170,7 @@ public class TokenController {
if (Objects.isNull(custCasual)) {
CustCasual insertCasual = new CustCasual();
openid = IdUtil.simpleUUID();
insertCasual.setCasualId(Id.next());
insertCasual.setCasualId(Id.next()); //TODO, NPE
insertCasual.setCasualName(result.getCustName());
insertCasual.setCustId(result.getCustId());
insertCasual.setMobile(result.getMobile());
@ -186,7 +186,8 @@ public class TokenController {
}
result.setOpenid(openid);
result.setMobile(AesEncryptUtil.aesEncrypt(result.getMobile()));
result.setCustName(SM4EncryptUtils.sm4Decrypt(result.getCustName()));
result.setMobile(AesEncryptUtil.aesEncrypt(SM4EncryptUtils.sm4Decrypt(result.getMobile())));
return result;
}

View File

@ -6,7 +6,7 @@
select cust_id, cust_name, cust_num, cust_photo_url, mobile, pwd
from cust_info
<where>
cust_status = 1 and (psn_type != 999 or psn_type is null)
cust_state = 1 and (psn_type != 999 or psn_type is null)
<if test="custName != null and custName != ''">
and cust_name = #{custName}
</if>