refactor: 重构实体类并添加Lombok注解 docs: 更新数据库表结构文档 style: 清理无用代码并优化格式 fix: 修复用户详情服务中的联系方式更新方法 build: 更新pom.xml配置并添加Lombok插件 test: 添加用户登录测试用例 chore: 添加开发和生产环境配置文件
58 lines
2.1 KiB
Java
58 lines
2.1 KiB
Java
// /*
|
|
// * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
|
// * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
|
|
// */
|
|
// package com.qf.backend.config;
|
|
|
|
// import org.springframework.context.annotation.Bean;
|
|
// import org.springframework.context.annotation.Configuration;
|
|
// import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
|
// import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
|
// import org.springframework.security.provisioning.InMemoryUserDetailsManager;
|
|
// import org.springframework.security.web.SecurityFilterChain;
|
|
|
|
// /**
|
|
// * 安全配置类(仅开发 禁用安全认证)
|
|
// *
|
|
// * @author 30803
|
|
// */
|
|
// @Configuration
|
|
// @EnableWebSecurity
|
|
// public class SecurityConfig {
|
|
|
|
// @Bean
|
|
// public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
|
// http
|
|
// .authorizeHttpRequests(auth -> auth
|
|
// .requestMatchers("/users/**").permitAll() // 公开路径
|
|
// .requestMatchers("/admin/**").hasRole("ADMIN") // 需要 ADMIN 角色
|
|
// .anyRequest().authenticated() // 其他请求需登录
|
|
// )
|
|
// .formLogin(form -> form
|
|
// .loginPage("/login") // 自定义登录页(可选)
|
|
// .permitAll()
|
|
// )
|
|
// .logout(logout -> logout
|
|
// .permitAll()
|
|
// );
|
|
// return http.build();
|
|
// }
|
|
|
|
// @Bean
|
|
// public UserDetailsService userDetailsService() {
|
|
// UserDetails user = User.withDefaultPasswordEncoder()
|
|
// .username("user")
|
|
// .password("123456")
|
|
// .roles("USER")
|
|
// .build();
|
|
|
|
// UserDetails admin = User.withDefaultPasswordEncoder()
|
|
// .username("admin")
|
|
// .password("admin123")
|
|
// .roles("USER", "ADMIN")
|
|
// .build();
|
|
|
|
// return new InMemoryUserDetailsManager(user, admin);
|
|
// }
|
|
// }
|