springboot+shiro实现用户登录认证和权限管理(二)
搭建springboot项目
为了密码的安全性,在一般的md5基础上引入加盐加密,在添加用户时随机生成盐值,存到数据库。
引入shiro配置:
注意要引入加盐加密,所以要自己实现HashedCredentialsMatcher接口,再重写方法doCredentialsMatch
package com.zzx.customer.config.shiro;
import org.apache.shiro.authc.credential.HashedCredentialsMatcher;
import or
原创
2021-01-06 11:21:56 ·
494 阅读 ·
6 评论