feat(security): 实现JWT认证并增强API安全控制
添加JWT依赖并实现token生成与验证功能 在控制器方法上添加权限注解保护API端点 更新安全配置以集成JWT过滤器 移除无用的编码测试工具类 修改JWT相关配置为更安全的设置
This commit is contained in:
@@ -72,10 +72,10 @@ management.endpoint.health.show-details=when_authorized
|
||||
management.metrics.export.prometheus.enabled=true
|
||||
|
||||
# JWT配置 - 生产环境应使用更安全的密钥和环境变量
|
||||
jwt.secret=mySecretKey
|
||||
jwt.secret=myAfterProjectSecretKey2024SecureJwtTokenGeneration
|
||||
jwt.expiration=86400000
|
||||
jwt.header=Authorization
|
||||
jwt.token-prefix=Bearer
|
||||
jwt.token-prefix=Bearer
|
||||
|
||||
# CORS配置 - 生产环境应限制允许的源
|
||||
cors.allowed-origins=http://localhost:3000
|
||||
|
||||
Reference in New Issue
Block a user