mirror of
https://git.mirrors.martin98.com/https://github.com/cilame/v_jstools
synced 2025-08-16 18:36:07 +08:00
add
This commit is contained in:
parent
a75b81ab1c
commit
955d806051
@ -91,7 +91,7 @@ import json
|
|||||||
import traceback
|
import traceback
|
||||||
import threading
|
import threading
|
||||||
from urllib.parse import unquote
|
from urllib.parse import unquote
|
||||||
from flask import Flask, request
|
from flask import Flask, request, jsonify
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
@app.route('/getinfo', methods=['GET'])
|
@app.route('/getinfo', methods=['GET'])
|
||||||
def main():
|
def main():
|
||||||
@ -101,7 +101,7 @@ def main():
|
|||||||
async with websockets.connect("ws://127.0.0.1:{}/getinfo".format(WSS_SERVER_PORT)) as websocket:
|
async with websockets.connect("ws://127.0.0.1:{}/getinfo".format(WSS_SERVER_PORT)) as websocket:
|
||||||
await websocket.send(info)
|
await websocket.send(info)
|
||||||
return await websocket.recv()
|
return await websocket.recv()
|
||||||
return asyncio.run(clientRun())
|
return jsonify({"message": asyncio.run(clientRun())})
|
||||||
except:
|
except:
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
return "启动接口失败."
|
return "启动接口失败."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user