Commit 21d796a1 by yanglei

update

parent a951b22e
......@@ -22,13 +22,16 @@ def login():
json_date = request.get_json()
number = json_date["number"]
password = json_date['password']
key = json_date["key"]
#手机号登录
phone_result = Management.query.filter_by(phone=number, status=1).first()
if phone_result:
# 进行密码验证
if phone_result.check_password(password) == True:
token_making = generate_token(key, 360)
# 从获取库里获取key
return BaseResponse()
ky = phone_result.key
return BaseResponse(data=certify_token(ky, token_making))
else:
return BaseResponse(**PASSWORD_ERROR)
......@@ -37,7 +40,10 @@ def login():
if user_result:
# 进行密码验证
if user_result.check_password(password) == True:
return BaseResponse()
token_making = generate_token(key, 360)
# 从获取库里获取key
ky = user_result.key
return BaseResponse(data=certify_token(ky, token_making))
else:
return BaseResponse(**PASSWORD_ERROR)
......
......@@ -79,7 +79,7 @@ def details():
"place_id": result.place_id,
"back_money": result.back_money,
"is_pay": result.is_pay,
"rent_pay": result.rent_pay,
"rent_type": result.rent_type,
"add_time": result.add_time,
"pay_time": result.pay_time,
"over_time": result.over_time
......
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