feat(security): 添加 JWT 认证功能
- 在后端添加 JWT 认证过滤器 JwtAuthenticationTokenFilter - 创建 JwtTokenUtil 工具类用于生成和验证 JWT token - 在 application.yml 中配置 JWT 相关参数 - 更新前端 HomePage 组件,增加用户认证相关逻辑
This commit is contained in:
@@ -3,10 +3,11 @@ package com.test.bijihoudaun.mapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.test.bijihoudaun.entity.User;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
@Mapper
|
||||
public interface UserMapper extends BaseMapper<User> {
|
||||
// 自定义查询方法示例
|
||||
// @Select("SELECT * FROM user WHERE username = #{username}")
|
||||
// User findByUsername(String username);
|
||||
@Select("SELECT * FROM user WHERE username = #{username}")
|
||||
User findByUsername(String username);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user