该flask为fastapi,速度更快
This commit is contained in:
parent
e5a0754e7f
commit
b5fee91e28
@ -5,8 +5,6 @@
|
|||||||
# Author: xaoyaoo
|
# Author: xaoyaoo
|
||||||
# Date: 2023/12/14
|
# Date: 2023/12/14
|
||||||
# -------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------
|
||||||
|
|
||||||
import logging
|
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
@ -28,7 +26,7 @@ from pywxdump import __version__
|
|||||||
|
|
||||||
app = FastAPI(title="pywxdump", description="微信工具", version=__version__,
|
app = FastAPI(title="pywxdump", description="微信工具", version=__version__,
|
||||||
terms_of_service="https://github.com/xaoyaoo/pywxdump",
|
terms_of_service="https://github.com/xaoyaoo/pywxdump",
|
||||||
contact={"name": "xaoyaoo", "url": "https://github.com/xaoyaoo/pywxdump", "email": "<EMAIL>"},
|
contact={"name": "xaoyaoo", "url": "https://github.com/xaoyaoo/pywxdump"},
|
||||||
license_info={"name": "MIT License", "url": "https://github.com/xaoyaoo/pywxdump/blob/main/LICENSE"})
|
license_info={"name": "MIT License", "url": "https://github.com/xaoyaoo/pywxdump/blob/main/LICENSE"})
|
||||||
|
|
||||||
# 跨域
|
# 跨域
|
||||||
@ -65,8 +63,9 @@ async def index():
|
|||||||
app.include_router(rs_api, prefix='/api/rs', tags=['远程api'])
|
app.include_router(rs_api, prefix='/api/rs', tags=['远程api'])
|
||||||
app.include_router(ls_api, prefix='/api/ls', tags=['本地api'])
|
app.include_router(ls_api, prefix='/api/ls', tags=['本地api'])
|
||||||
|
|
||||||
web_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), "ui", "web")
|
|
||||||
# 静态文件挂载
|
# 静态文件挂载
|
||||||
|
web_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), "ui", "web")
|
||||||
|
if os.path.exists(os.path.join(web_path, "index.html")):
|
||||||
app.mount("/s", StaticFiles(directory=web_path), name="static")
|
app.mount("/s", StaticFiles(directory=web_path), name="static")
|
||||||
|
|
||||||
|
|
||||||
|
@ -254,7 +254,7 @@ class BiasAddrRequest(BaseModel):
|
|||||||
|
|
||||||
@ls_api.post('/biasaddr')
|
@ls_api.post('/biasaddr')
|
||||||
@error9999
|
@error9999
|
||||||
def biasaddr(request: BiasAddrRequest):
|
def get_biasaddr(request: BiasAddrRequest):
|
||||||
"""
|
"""
|
||||||
BiasAddr
|
BiasAddr
|
||||||
:return:
|
:return:
|
||||||
@ -273,7 +273,7 @@ def biasaddr(request: BiasAddrRequest):
|
|||||||
|
|
||||||
@ls_api.api_route('/decrypt', methods=["GET", 'POST'])
|
@ls_api.api_route('/decrypt', methods=["GET", 'POST'])
|
||||||
@error9999
|
@error9999
|
||||||
def decrypt(key: str, wxdbPath: str, outPath: str = ""):
|
def get_decrypt(key: str, wxdbPath: str, outPath: str = ""):
|
||||||
"""
|
"""
|
||||||
解密
|
解密
|
||||||
:return:
|
:return:
|
||||||
@ -291,7 +291,7 @@ class MergeRequest(BaseModel):
|
|||||||
|
|
||||||
@ls_api.post('/merge')
|
@ls_api.post('/merge')
|
||||||
@error9999
|
@error9999
|
||||||
def merge(request: MergeRequest):
|
def get_merge(request: MergeRequest):
|
||||||
"""
|
"""
|
||||||
合并
|
合并
|
||||||
:return:
|
:return:
|
||||||
|
Loading…
Reference in New Issue
Block a user