fix:客户端断开连接时,服务端处理websocket异常

This commit is contained in:
zy7y
2022-09-17 19:10:11 +08:00
parent 8e37bba724
commit 85a38a0840
6 changed files with 20 additions and 22 deletions

View File

@@ -2,7 +2,7 @@ from typing import Any, Callable, get_type_hints
from fastapi import Depends, routing
from controller.common import about, login
from controller.common import about, login, websocket
from controller.menu import menu_add, menu_arr, menu_del, menu_put
from controller.role import (
role_add,
@@ -172,6 +172,7 @@ routes = [
Route.put(
"/menu/{pk}", endpoint=menu_put, tags=["菜单管理"], summary="菜单更新", **has_perm
),
routing.APIWebSocketRoute("/ws", endpoint=websocket),
]
__all__ = [routes]