refactor(fam-core): 移除 SS Webhook 可选路径与 NAS 静态前端托管,兜底 Oracle 地址更新为 129.146.26.249
This commit is contained in:
@@ -23,22 +23,19 @@ from .member_manager.member_manager import member_bp
|
||||
from .img_proxy import img_bp
|
||||
from .motion_bp import motion_bp
|
||||
from .ui_api import ui_bp
|
||||
from .static_app import static_bp
|
||||
from .auth import auth_bp, init_auth
|
||||
|
||||
logger = setup_logger('fam-core.app')
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
# 注册蓝图:/api/* 系列必须先于 static_bp 注册——static_bp 是通配兜底路由
|
||||
# (Vue Router history 模式回退 index.html),排在前面会吞掉 API 请求。
|
||||
# 注册蓝图:全部 /api/* 路由(前端已迁云服务器 Caddy:80,NAS 不再托管 SPA 静态文件)
|
||||
app.register_blueprint(chat_bp)
|
||||
app.register_blueprint(member_bp)
|
||||
app.register_blueprint(img_bp)
|
||||
app.register_blueprint(motion_bp)
|
||||
app.register_blueprint(ui_bp)
|
||||
app.register_blueprint(auth_bp) # 登录页 /api/login 等(static_bp 通配之前)
|
||||
app.register_blueprint(static_bp)
|
||||
app.register_blueprint(auth_bp)
|
||||
|
||||
# 登录校验全局拦截(页面未登录 302 /login;/api/* 未登录 401)
|
||||
init_auth(app)
|
||||
@@ -64,17 +61,11 @@ try:
|
||||
except Exception as e:
|
||||
logger.error(f"Oracle-Sync 启动失败: {e}")
|
||||
|
||||
# 初始化运动监测通知服务(Webhook 驱动,不轮询;提供推送客户端 + 摄像头名映射)
|
||||
# 初始化运动监测通知服务(NAS 轮询 SS EventCenter 主路径)
|
||||
_notifier = None
|
||||
try:
|
||||
_notifier = get_motion_notifier()
|
||||
_notifier.start()
|
||||
# 启动时一次性从 SS 拉取摄像头名->id 映射(非轮询),失败仅告警,Webhook 仍可运行
|
||||
try:
|
||||
_notifier.refresh_camera_map()
|
||||
logger.info("MotionNotifier 摄像头映射已加载")
|
||||
except Exception as e:
|
||||
logger.warning(f"摄像头映射加载失败(Webhook 仍可运行,camera_id 可能为空): {e}")
|
||||
logger.info("MotionNotifier 已初始化")
|
||||
except Exception as e:
|
||||
logger.error(f"MotionNotifier 初始化失败: {e}")
|
||||
|
||||
Reference in New Issue
Block a user