Files
lablesys_backend/src/main/java/com/labelsys/backend/config/SecurityBeanConfig.java

28 lines
808 B
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.labelsys.backend.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
/**
* 安全配置类
*
* 配置安全相关的 Bean如密码编码器等。
*/
@Configuration
public class SecurityBeanConfig {
/**
* 创建密码编码器
*
* <p>使用 BCrypt 算法对密码进行加密BCrypt 是一种安全的密码哈希算法,
* 具有自动加盐和可配置的计算复杂度特性。
*
* @return BCryptPasswordEncoder 实例
*/
@Bean
public PasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();
}
}