from flask_restful import Resource, reqparse from flask import jsonify,request,json from common import redis_helper,utils from wechat import gewe_chat class GetLoginInfoResource(Resource): def __init__(self): self.parser = reqparse.RequestParser() self.wxchat = gewe_chat.wxchat def post(self): req = request.get_json() tel = req.get("tel") config=self.wxchat.get_login_info_from_cache(tel) return jsonify(config) class LoginWxCaptchCodeResource(Resource): def __init__(self): self.parser = reqparse.RequestParser() self.wxchat = gewe_chat.wxchat def post(self): req = request.get_json() token_id = req.get("token_id") captch_code= req.get("captch_code") res=self.wxchat.save_login_wx_captch_code_to_cache(token_id,captch_code) return jsonify(res)