Integrate KDocs auto-upload
This commit is contained in:
22
database.py
22
database.py
@@ -100,6 +100,7 @@ from db.users import (
|
||||
get_pending_users,
|
||||
get_user_by_id,
|
||||
get_user_by_username,
|
||||
get_user_kdocs_settings,
|
||||
get_user_stats,
|
||||
get_user_vip_info,
|
||||
get_vip_config,
|
||||
@@ -108,6 +109,7 @@ from db.users import (
|
||||
remove_user_vip,
|
||||
set_default_vip_days,
|
||||
set_user_vip,
|
||||
update_user_kdocs_settings,
|
||||
verify_user,
|
||||
)
|
||||
from db.security import record_login_context
|
||||
@@ -118,7 +120,7 @@ config = get_config()
|
||||
DB_FILE = config.DB_FILE
|
||||
|
||||
# 数据库版本 (用于迁移管理)
|
||||
DB_VERSION = 16
|
||||
DB_VERSION = 17
|
||||
|
||||
|
||||
# ==================== 系统配置缓存(P1 / O-03) ====================
|
||||
@@ -194,6 +196,15 @@ def update_system_config(
|
||||
auto_approve_enabled=None,
|
||||
auto_approve_hourly_limit=None,
|
||||
auto_approve_vip_days=None,
|
||||
kdocs_enabled=None,
|
||||
kdocs_doc_url=None,
|
||||
kdocs_default_unit=None,
|
||||
kdocs_sheet_name=None,
|
||||
kdocs_sheet_index=None,
|
||||
kdocs_unit_column=None,
|
||||
kdocs_image_column=None,
|
||||
kdocs_admin_notify_enabled=None,
|
||||
kdocs_admin_notify_email=None,
|
||||
):
|
||||
"""更新系统配置(写入后立即失效缓存)。"""
|
||||
ok = _update_system_config(
|
||||
@@ -211,6 +222,15 @@ def update_system_config(
|
||||
auto_approve_enabled=auto_approve_enabled,
|
||||
auto_approve_hourly_limit=auto_approve_hourly_limit,
|
||||
auto_approve_vip_days=auto_approve_vip_days,
|
||||
kdocs_enabled=kdocs_enabled,
|
||||
kdocs_doc_url=kdocs_doc_url,
|
||||
kdocs_default_unit=kdocs_default_unit,
|
||||
kdocs_sheet_name=kdocs_sheet_name,
|
||||
kdocs_sheet_index=kdocs_sheet_index,
|
||||
kdocs_unit_column=kdocs_unit_column,
|
||||
kdocs_image_column=kdocs_image_column,
|
||||
kdocs_admin_notify_enabled=kdocs_admin_notify_enabled,
|
||||
kdocs_admin_notify_email=kdocs_admin_notify_email,
|
||||
)
|
||||
if ok:
|
||||
invalidate_system_config_cache()
|
||||
|
||||
Reference in New Issue
Block a user