三种读取配置内容的方式
@Value
@Value(value = "${user.password.lockTime}")
Environment
@Autowired
Environment environment;
environment.getProperty("env");
@ConfigurationProperties
@ConfigurationProperties(prefix = "ruoyi")
setter,getter方法对该字段
springboot启动后,从高到低的优先级加载配置
file:/config/当前项目的config目录下(位于idea的project files上一级目录)
file:./当前项目的根目录
classpath:/config/:classpath的config目录
classpath:/ classpath的根目录(java,resource都会打包到classpath里中
Spring Security默认是禁用注解的,要想开启注解,需要在继承WebSecurityConfigurerAdapter的类上加@EnableGlobalMethodSecurity注解,来判断用户对某个控制层的方法是否具有访问权限
@PreAuthorize 在方法调用之前,基于表达式的计算结果来限制对方法的访问
密码加密BCryptPasswordEncoder:encode(使用md5方法)和matches方法(每次生成的字符串不同,只能使用这个方法判断)