shikeyin
2024-01-11 65da8373531677b1c37a98f53eaa30c892f35e5a
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
package com.iplatform.security.config;
 
import org.springframework.boot.context.properties.ConfigurationProperties;
 
import java.util.List;
 
@ConfigurationProperties(prefix = "iplatform.security")
public class SecurityProperties {
 
    private List<String> anonymousList = null;
 
    private List<String> permitList = null;
 
    private String supervisorPassword = null;
 
    private boolean corsEnabled = false;
 
    private boolean allowPcUserAccessApp = true;
 
    private long tokenExpireWeb = 120;              // PC端默认2小时
    private long tokenExpireMobile = 60 * 24 * 15;  // 移动端默认15天
 
    // 支持手机登录时自动注册(手机不存在则,直接注册)
    private boolean allowMobileLoginReg = false;
 
    private boolean userNameIsPhone = false;
 
    /**
     * 用户体系(用户名)都是手机号。
     * @return
     * @date 2023-06-28
     */
    public boolean isUserNameIsPhone() {
        return userNameIsPhone;
    }
 
    public void setUserNameIsPhone(boolean userNameIsPhone) {
        this.userNameIsPhone = userNameIsPhone;
    }
 
    /**
     * 支持手机登录时自动注册(手机不存在则,直接注册)
     * @return
     * @date 2023-06-28
     */
    public boolean isAllowMobileLoginReg() {
        return allowMobileLoginReg;
    }
 
    public void setAllowMobileLoginReg(boolean allowMobileLoginReg) {
        this.allowMobileLoginReg = allowMobileLoginReg;
    }
 
    /**
     * 返回PC端token失效时间(分钟),默认:120
     * @return
     * @date 2023-03-28
     */
    public long getTokenExpireWeb() {
        return tokenExpireWeb;
    }
 
    public void setTokenExpireWeb(long tokenExpireWeb) {
        this.tokenExpireWeb = tokenExpireWeb;
    }
 
    /**
     * 返回移动端token失效时间(分钟),默认:60 * 24 * 15 (15天)
     * @return
     * @date 2023-03-28
     */
    public long getTokenExpireMobile() {
        return tokenExpireMobile;
    }
 
    public void setTokenExpireMobile(long tokenExpireMobile) {
        this.tokenExpireMobile = tokenExpireMobile;
    }
 
    public boolean isAllowPcUserAccessApp() {
        return allowPcUserAccessApp;
    }
 
    /**
     * 设置是否允许'后台PC用户'访问登录手机APP
     * @param allowPcUserAccessApp
     * @date 2023-03-20
     */
    public void setAllowPcUserAccessApp(boolean allowPcUserAccessApp) {
        this.allowPcUserAccessApp = allowPcUserAccessApp;
    }
 
    /**
     * 是否启用跨域配置,在 Gateway 模式下,由于网关已经配置,这里业务就不需要重复配置了。
     * @return
     * @date 2022-12-28
     */
    public boolean isCorsEnabled() {
        return corsEnabled;
    }
 
    public void setCorsEnabled(boolean corsEnabled) {
        this.corsEnabled = corsEnabled;
    }
 
    /**
     * 获取超级管理员密码(秘文)
     * @return
     * @date 2022-12-02
     */
    public String getSupervisorPassword() {
        return supervisorPassword;
    }
 
    public void setSupervisorPassword(String supervisorPassword) {
        this.supervisorPassword = supervisorPassword;
    }
 
    /**
     * 获得配置的已认证用户都能访问的地址集合。
     * @return
     * @date 2022-11-13
     */
    public List<String> getPermitList() {
        return permitList;
    }
 
    public void setPermitList(List<String> permitList) {
        this.permitList = permitList;
    }
 
    /**
     * 获得配置的匿名访问地址集合
     * @return
     */
    public List<String> getAnonymousList() {
        return anonymousList;
    }
 
    public void setAnonymousList(List<String> anonymousList) {
        this.anonymousList = anonymousList;
    }
 
    /**
     * 用户名密码方式登录,配置的验证码提供者。
     * @return
     * @date 2023-03-14
     */
    public String getLoginCaptchaUserPass() {
        return loginCaptchaUserPass;
    }
 
    public void setLoginCaptchaUserPass(String loginCaptchaUserPass) {
        this.loginCaptchaUserPass = loginCaptchaUserPass;
    }
 
    /**
     * 手机短信登录方式,配置的验证码提供者。
     * @return
     * @date 2023-03-14
     */
    public String getLoginCaptchaSmsCode() {
        return loginCaptchaSmsCode;
    }
 
    public void setLoginCaptchaSmsCode(String loginCaptchaSmsCode) {
        this.loginCaptchaSmsCode = loginCaptchaSmsCode;
    }
 
    private String loginCaptchaUserPass = null;
    private String loginCaptchaSmsCode = null;
}