Commit b6e13fe2 by wang_jiaxing

修改登陆校验的密码加密方式

parent 403c54bd
...@@ -21,6 +21,7 @@ import org.springblade.core.tool.utils.Func; ...@@ -21,6 +21,7 @@ import org.springblade.core.tool.utils.Func;
import org.springblade.modules.system.entity.UserInfoResult; import org.springblade.modules.system.entity.UserInfoResult;
import org.springblade.modules.system.service.IUserService; import org.springblade.modules.system.service.IUserService;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import sun.misc.BASE64Encoder;
/** /**
* PasswordTokenGranter * PasswordTokenGranter
...@@ -44,8 +45,10 @@ public class PasswordTokenGranter implements ITokenGranter { ...@@ -44,8 +45,10 @@ public class PasswordTokenGranter implements ITokenGranter {
if (Func.isNoneBlank(account, password)) { if (Func.isNoneBlank(account, password)) {
// 获取用户类型 // 获取用户类型
String userType = tokenParameter.getArgs().getStr("userType"); String userType = tokenParameter.getArgs().getStr("userType");
BASE64Encoder encoder = new BASE64Encoder();
// 根据不同用户类型调用对应的接口返回数据,用户可自行拓展 // 根据不同用户类型调用对应的接口返回数据,用户可自行拓展
userInfo = userService.userInfoR(tenantId, account, DigestUtil.encrypt(password)); userInfo = userService.userInfoR(tenantId, account, encoder.encode(password.getBytes()));
// userInfo = userService.userInfoR(tenantId, account, DigestUtil.encrypt(password));
// if (userType.equals(BladeUserEnum.WEB.getName())) { // if (userType.equals(BladeUserEnum.WEB.getName())) {
// userInfo = userService.userInfo(tenantId, account, DigestUtil.encrypt(password)); // userInfo = userService.userInfo(tenantId, account, DigestUtil.encrypt(password));
// } else if (userType.equals(BladeUserEnum.APP.getName())) { // } else if (userType.equals(BladeUserEnum.APP.getName())) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment