清理多余 .env 配置项
1. 后端删除无引用配置:DB_MAX_OVERFLOW、LABOR_POINTS_ADD/SUBTRACT、六个角色加减分上限(v4.0起由权限组动态配置) 2. 前端删除未使用配置:SESSION_TIMEOUT、STUDENT_INITIAL_POINTS(同步移除 config.php 必填项与常量) 3. 修正 backend/.env.example 标题与 config.php 重复注释 4. config.py 与 .env.example 键值 1:1 校验通过(48项,无多余/缺失)
This commit is contained in:
1 parent
ed3189096d
commit
990f44bf22
4 files changed
+3
-55
No files matched your search
@@ -24,12 +24,8 @@ USER_STORAGE_KEY=class_system_user
|
||||
# 站点名称
|
||||
SITE_NAME=班级操行分管理系统
|
||||
|
||||
# 会话超时时间(分钟)
|
||||
SESSION_TIMEOUT=30
|
||||
|
||||
# ICP备案号配置
|
||||
# 是否启用ICP备案号显示 - true/false
|
||||
ICP_ENABLED=false
|
||||
# ICP备案号
|
||||
ICP_NUMBER=京ICP备1234567890号-x
|
||||
STUDENT_INITIAL_POINTS=60
|
||||
ICP_NUMBER=京ICP备1234567890号-x
|
||||
+1
-3
@@ -38,7 +38,7 @@ foreach ($lines as $line) {
|
||||
}
|
||||
|
||||
// 检查必要配置是否存在
|
||||
$requiredKeys = ['API_BASE_URL', 'API_TIMEOUT', 'JWT_STORAGE_KEY', 'USER_STORAGE_KEY', 'SITE_NAME', 'SESSION_TIMEOUT', 'ICP_ENABLED', 'ICP_NUMBER'];
|
||||
$requiredKeys = ['API_BASE_URL', 'API_TIMEOUT', 'JWT_STORAGE_KEY', 'USER_STORAGE_KEY', 'SITE_NAME', 'ICP_ENABLED', 'ICP_NUMBER'];
|
||||
$missingKeys = [];
|
||||
|
||||
foreach ($requiredKeys as $key) {
|
||||
@@ -57,11 +57,9 @@ define('API_TIMEOUT', (int)$config['API_TIMEOUT']);
|
||||
define('JWT_STORAGE_KEY', $config['JWT_STORAGE_KEY']);
|
||||
define('USER_STORAGE_KEY', $config['USER_STORAGE_KEY']);
|
||||
define('SITE_NAME', $config['SITE_NAME']);
|
||||
define('SESSION_TIMEOUT', (int)$config['SESSION_TIMEOUT']);
|
||||
define('ICP_ENABLED', $config['ICP_ENABLED'] !== 'false');
|
||||
define('ICP_NUMBER', $config['ICP_NUMBER'] ?? '');
|
||||
// 会话配置
|
||||
// 会话配置
|
||||
ini_set('session.cookie_httponly', 1);
|
||||
ini_set('session.use_only_cookies', 1);
|
||||
ini_set('session.cookie_secure', 1);
|
||||
|
||||
Reference in new issue
Block a user