2
0

style: 更新用户平台模块数据库数据

This commit is contained in:
TsMask
2024-11-27 16:10:57 +08:00
parent a075adea36
commit 724e9e4775
2 changed files with 40 additions and 34 deletions

View File

@@ -0,0 +1,16 @@
import org.wfc.common.security.utils.SecurityUtils;
public class TestBCrypt {
public static void main(String[] args) {
// 测试密码加密
String password = "123456";
String encryptedPassword = SecurityUtils.encryptPassword(password);
System.out.println(password + " 加密=> " + encryptedPassword);
// 验证原密码和加密密码是否匹配
boolean match = SecurityUtils.matchesPassword(password, encryptedPassword);
if (match) {
System.out.println("匹配原密码");
}
}
}