Commit 06ac6779 by 熊付

【登陆接口】

1 parent 0b839908
#!/usr/bin/evn python
# coding=utf-8
from flask import Blueprint, request
import time,json
import apps.gbvar.dict_properties as dict_p
login = Blueprint('login', __name__)
@login.route('/login',methods=['POST'])
def login1():
data = request.get_data ()
print data
result = {
"user_unid": time.time(), # 必填,用户unid
"user_type": "device", # 可选,用户类型,不出现表示"user",即普通用户。
"atoken": time.time(), # 必填,用户的atoken
"atoken_edt": time.strftime ( "%Y-%m-%d %H:%M:%S", time.localtime(time.time())), # 必填,atoken到期时间
"rtoken": time.time(), # 可选,用户的rtoken
"rtoken_edt": time.strftime ( "%Y-%m-%d %H:%M:%S", time.localtime(time.time())), # 可选,rtoken到期时间
}
return json.dumps ( result, ensure_ascii=False )
@login.route('/recv_data/url',methods=['GET'])
def get_recv_url():
return 'http://%s:%s/api/v1/tx1_box/events' % (dict_p.get_value()['tx1_host'],dict_p.get_value()['tx1_http_port'])
\ No newline at end of file
No preview for this file type
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!