mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-05 07:27:15 +08:00
Merge pull request #3596 from InfinityPacer/feature/module
This commit is contained in:
@@ -4,6 +4,7 @@ from fastapi import FastAPI
|
|||||||
|
|
||||||
from app.core.config import global_vars, settings
|
from app.core.config import global_vars, settings
|
||||||
from app.core.module import ModuleManager
|
from app.core.module import ModuleManager
|
||||||
|
from app.log import logger
|
||||||
from app.utils.system import SystemUtils
|
from app.utils.system import SystemUtils
|
||||||
|
|
||||||
# SitesHelper涉及资源包拉取,提前引入并容错提示
|
# SitesHelper涉及资源包拉取,提前引入并容错提示
|
||||||
@@ -78,13 +79,15 @@ def user_auth():
|
|||||||
"""
|
"""
|
||||||
用户认证检查
|
用户认证检查
|
||||||
"""
|
"""
|
||||||
if SitesHelper().auth_level >= 2:
|
sites_helper = SitesHelper()
|
||||||
|
if sites_helper.auth_level >= 2:
|
||||||
return
|
return
|
||||||
auth_conf = SystemConfigOper().get(SystemConfigKey.UserSiteAuthParams)
|
auth_conf = SystemConfigOper().get(SystemConfigKey.UserSiteAuthParams)
|
||||||
if auth_conf:
|
status, msg = sites_helper.check_user(**auth_conf) if auth_conf else sites_helper.check_user()
|
||||||
SitesHelper().check_user(**auth_conf)
|
if status:
|
||||||
|
logger.info(f"{msg} 用户认证成功")
|
||||||
else:
|
else:
|
||||||
SitesHelper().check_user()
|
logger.info(f"用户认证失败:{msg}")
|
||||||
|
|
||||||
|
|
||||||
def check_auth():
|
def check_auth():
|
||||||
|
|||||||
Reference in New Issue
Block a user