Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

31 lines
883B

  1. from flask_restful import Resource, reqparse
  2. from flask import jsonify,request,json
  3. from common import redis_helper,utils
  4. from wechat import gewe_chat
  5. class GetLoginInfoResource(Resource):
  6. def __init__(self):
  7. self.parser = reqparse.RequestParser()
  8. self.wxchat = gewe_chat.wxchat
  9. def post(self):
  10. req = request.get_json()
  11. tel = req.get("tel")
  12. config=self.wxchat.get_login_info_from_cache(tel)
  13. return jsonify(config)
  14. class LoginWxCaptchCodeResource(Resource):
  15. def __init__(self):
  16. self.parser = reqparse.RequestParser()
  17. self.wxchat = gewe_chat.wxchat
  18. def post(self):
  19. req = request.get_json()
  20. token_id = req.get("token_id")
  21. captch_code= req.get("captch_code")
  22. res=self.wxchat.save_login_wx_captch_code_to_cache(token_id,captch_code)
  23. return jsonify(res)