Files
TaoTaoWang_backend/src/main/java/com/qf/backend/service/UserLoginService.java
qingfeng1121 20f8a9d132 feat(security): 实现JWT认证与授权功能
重构用户登录服务,引入Spring Security和JWT认证机制
- 新增JwtUtils工具类处理JWT生成与验证
- 添加JwtAuthenticationFilter拦截请求验证token
- 实现UserDetailsService从数据库加载用户信息
- 创建AuthController处理登录请求返回JWT
- 重构用户角色权限相关接口,支持基于角色的访问控制
- 移除旧的安全配置,启用新的SecurityConfig
- 新增LoginResponse DTO替代旧的LoginUser
- 优化用户密码加密存储,使用BCryptPasswordEncoder
2025-12-04 14:03:29 +08:00

23 lines
623 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.

/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Interface.java to edit this template
*/
package com.qf.backend.service;
import com.qf.backend.common.Result;
import com.qf.backend.dto.LoginResponse;
/**
* 用户登录服务接口
*/
public interface UserLoginService {
/**
* 用户登录
* @param username 用户名
* @param password 密码
* @return 登录结果包含登录状态、token等信息
*/
Result<LoginResponse> login(String username, String password);
}