| | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import com.ruoyi.common.utils.sign.Md5Utils; |
| | | import org.springframework.security.core.Authentication; |
| | | import org.springframework.security.core.context.SecurityContextHolder; |
| | | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; |
| | |
| | | .anyMatch(x -> Constants.SUPER_ADMIN.equals(x) || PatternMatchUtils.simpleMatch(x, role)); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | String hash = Md5Utils.hash("123456"); |
| | | System.out.println(hash); |
| | | System.out.println(encryptPassword(hash)); |
| | | |
| | | System.out.println(matchesPassword(hash, "$2a$10$VhdvkOtOTUq1NndvwPC36./D9bPVhDJWbt.tVWtGdqW3.sA07Ikx.")); |
| | | } |
| | | |
| | | } |