Commit fa8b510d authored by fangzhipeng's avatar fangzhipeng

增加log

parent 0c3efcde
......@@ -7,6 +7,9 @@ from common import error_type
from common.error import BussinessException
from config import config
from daylife.dao import user_dao
import logging
from util import json_util
def login_require(func):
......@@ -23,6 +26,8 @@ def login_require(func):
if not user_id or not token:
raise BussinessException(error_type.NEED_LOGIN)
user_token = user_dao.select_user_token_info(token)
logging.info('user_id is ' + user_id + ', token is ' + token + ', user_token is '
+ json_util.convert_db_to_json_obj(user_token))
#token信息不存在或与存在信息不符合需要进行登录
if not (user_token and user_token.user_id == int(user_id)):
raise BussinessException(error_type.NEED_LOGIN)
......
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 to comment