PasswordConfig.java 618 Bytes
package com.xly.erp.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;

/**
 * REQ-USR-001 引入:BCryptPasswordEncoder 注册为 Spring bean,
 * 供 UserService.create / REQ-USR-004 登录校验复用。strength 用 BCrypt 默认(10)。
 */
@Configuration
public class PasswordConfig {

    @Bean
    public PasswordEncoder passwordEncoder() {
        return new BCryptPasswordEncoder();
    }
}