Commit 0b839908 by 熊付

【新增登陆注册接口】

1 parent cc1c2b35
...@@ -24,7 +24,9 @@ def dataRecv(): ...@@ -24,7 +24,9 @@ def dataRecv():
return data return data
@tx1_box.route('/test', methods=["GET"]) @tx1_box.route('/test', methods=["GET"])
def test(): def test():
return "test" print 'test'
print database.get_value()
return "111"
# 给所有用户发送信息 # 给所有用户发送信息
def send_all_data(sv, data): def send_all_data(sv, data):
if sv.users is not None and len ( sv.users ) > 0: if sv.users is not None and len ( sv.users ) > 0:
......
...@@ -6,9 +6,10 @@ import threading ...@@ -6,9 +6,10 @@ import threading
from api.http_serv import tx1_box from api.http_serv import tx1_box
from api.task import task from api.task import task
from api.ws_serv import Server from api.ws_serv import Server
import gbvar.ws_serv_global as sv_global from apps.api.login import login
import gbvar.database_global as database import apps.gbvar.ws_serv_global as sv_global
import gbvar.dict_properties as dict_p import apps.gbvar.database_global as database
import apps.gbvar.dict_properties as dict_p
import fdb import fdb
import sys import sys
import os import os
...@@ -26,6 +27,9 @@ app.register_blueprint(tx1_box, url_prefix='/api/v1/tx1_box') ...@@ -26,6 +27,9 @@ app.register_blueprint(tx1_box, url_prefix='/api/v1/tx1_box')
#注册task路由 #注册task路由
app.register_blueprint(task, url_prefix='/api/v1/tx1_box/task') app.register_blueprint(task, url_prefix='/api/v1/tx1_box/task')
#注册login路由
app.register_blueprint(login, url_prefix='/api/v1/tx1_box')
@app.route('/', methods=["GET"]) @app.route('/', methods=["GET"])
def index(): def index():
return flask.send_file ( "dist/index.html" ) return flask.send_file ( "dist/index.html" )
...@@ -55,12 +59,12 @@ def init(): ...@@ -55,12 +59,12 @@ def init():
database.set_value(cur) database.set_value(cur)
'''newLanguages = [ '''newLanguages = [
(1, 'Dylan') (2, 'Dylan3')
] ]
cur.executemany ( "insert into tb_traffic(id,name) VALUES(?,?)", cur.executemany ( "insert into tb_traffic(id,name) VALUES(?,?)",
newLanguages newLanguages
) )
con.commit () con.commit ()'''
sql_select = 'select * from tb_traffic' sql_select = 'select * from tb_traffic'
# 显示全部内容 # 显示全部内容
...@@ -68,7 +72,7 @@ def init(): ...@@ -68,7 +72,7 @@ def init():
print(cur.fetchall ()) print(cur.fetchall ())
cur.close () cur.close ()
con.close ()''' con.close ()
####====================database=================== ####====================database===================
#启动服务 #启动服务
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!