Commit eb8aa65b by dong

fix20230619

parent 2f4da1f0
......@@ -248,7 +248,7 @@ def login_bypwd():
if access_nums:
if int(access_nums.decode()) >= constants.LOGIN_ERROR_TIMES:
lock_time = redis_store.ttl('jincheng_access_nums_{}'.format(user_ip))
return jsonify(code=RET.LOCKTIME, msg="ip锁定倒计时中.....", lock_time=lock_time)
return jsonify(code=RET.LOCKTIME, msg="ip锁定倒计时中,还剩{}秒!".format(lock_time), lock_time=lock_time)
except Exception as e:
current_app.logger.error(e)
else:
......
......@@ -300,7 +300,7 @@ def introduction_meet():
flag = req_dict.get("flag")
try:
meet_obj_list = IntroductionMeet.query.filter(IntroductionMeet.flag == flag).paginate(page, perpage).items
meet_obj_list = IntroductionMeet.query.filter(IntroductionMeet.flag == flag).order_by(IntroductionMeet.time.desc()).paginate(page, perpage).items
meet_count = IntroductionMeet.query.count()
data = [{
......@@ -1006,14 +1006,20 @@ def wechat_login():
# 参数获取与校验
req_dict = request.get_json()
code = req_dict.get('code') # 微信登录code
flag = req_dict.get('flag') # 微信登录code
print(flag)
# 校验参数完整性
if not all([code]):
return jsonify(code=RET.PARAMERR, msg="Parameter incompleteness!")
# app_id = 'wx67c0a99d684274f8'
# app_secret = 'd89755bb5d2d3f85e97d0f08c30dbebc'
if flag == 1: # 投资晋城
app_id = 'wx78f5fa8193a9d06a'
app_secret = 'c7a57d430061fb4ca131e5148ff0e6fe'
if flag == 2: # jinlaitou
app_id = 'wx67c0a99d684274f8'
app_secret = 'd89755bb5d2d3f85e97d0f08c30dbebc'
data = {"code": code}
# 获取token
url = u'https://api.weixin.qq.com/cgi-bin/token'
......@@ -1029,6 +1035,7 @@ def wechat_login():
# 获取电话号码
url1 = u"https://api.weixin.qq.com/wxa/business/getuserphonenumber?access_token={}".format(access_token)
res1 = requests.post(url1, json=data).json()
print(res1)
user_info = ''
if res1['errmsg'] == 'ok':
mobile = res1['phone_info']["phoneNumber"]
......
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