hejianhao
2026-08-28 16a57a8fc6868cea9171a1119698572407a2fc03
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
28
29
30
31
package com.tcm.training.admin.app.auth.config;
 
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
 
/**
 * APP 登录认证配置。
 */
@Component
@ConfigurationProperties(prefix = "app.auth")
public class AppAuthProperties {
 
    /**
     * APP 登录 token 有效期,默认 30 天;设置为 -1 时表示永久有效。
     */
    private long tokenTimeoutSeconds = 30L * 24 * 60 * 60;
 
    /**
     * 获取 APP 登录 token 有效期秒数。
     */
    public long getTokenTimeoutSeconds() {
        return tokenTimeoutSeconds;
    }
 
    /**
     * 设置 APP 登录 token 有效期秒数。
     */
    public void setTokenTimeoutSeconds(long tokenTimeoutSeconds) {
        this.tokenTimeoutSeconds = tokenTimeoutSeconds;
    }
}