Commit b1a699a5 by 陈森彬

处理请求的格式不正确的情况

parent 0a001818
Showing with 4 additions and 2 deletions
...@@ -7,7 +7,7 @@ import tornado.web ...@@ -7,7 +7,7 @@ import tornado.web
import tornado.ioloop import tornado.ioloop
from utils.functions import pre_judge, word_conversion, cut_params, check_param, unit_conversion, get_not_exist_list, \ from utils.functions import pre_judge, word_conversion, cut_params, check_param, unit_conversion, get_not_exist_list, \
check_encap, check_temp , check_symbol check_encap, check_temp, check_symbol
from utils.redis_cli import redis_cli from utils.redis_cli import redis_cli
from predict.kw_predict import KwPredict from predict.kw_predict import KwPredict
...@@ -97,10 +97,12 @@ class UCHandler(tornado.web.RequestHandler): ...@@ -97,10 +97,12 @@ class UCHandler(tornado.web.RequestHandler):
async def post(self): async def post(self):
data_list = json.loads(self.request.body) data_list = json.loads(self.request.body)
print(data_list)
if not data_list: if not data_list:
code = '100002' code = '100002'
res = code2msg(code) res = code2msg(code)
elif type(data_list) != list:
code = '100001'
res = code2msg(code)
else: else:
res = {} res = {}
attrs_list = [] attrs_list = []
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment