jiangping
2025-01-08 a35b8eec96aac2793de732c3fb7513cd6c5b2e4c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package com.doumee.config.jwt;
 
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
 
@Data
@ConfigurationProperties(prefix = "auth.jwt")
@Component
public class JwtProperties {
 
    //是否开启JWT,即注入相关的类对象
    private Boolean enabled;
    //JWT密钥
    private String secret;
    //JWT有效时间
    private Long expiration;
    //前端向后端传递JWT时使用HTTP的header名称,前后端要统一
    private String header;
    //用户登录-用户名参数名称
    private String userParamName = "username";
    //用户登录-密码参数名称
    private String pwdParamName = "password";
    //是否使用默认的JWTAuthController
    private Boolean useDefaultController = false;
 
}