You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
724 B
Python
28 lines
724 B
Python
# -*- coding: utf-8 -*-
|
|
import json
|
|
import logging
|
|
import os
|
|
from random import sample
|
|
from string import ascii_letters, digits
|
|
|
|
from flask import Flask, jsonify, request
|
|
from flask_redis import FlaskRedis
|
|
|
|
|
|
app = Flask(__name__)
|
|
app.config['REDIS_URL'] = "redis://192.168.3.15:6379/0"
|
|
redis = FlaskRedis(app)
|
|
|
|
@app.route('/game/wxcallback', methods=['POST'])
|
|
def wxcallback():
|
|
a = redis.get("abc")
|
|
print("a = ", a.decode('utf-8'))
|
|
if a.decode('utf-8') == "1":
|
|
print("a tp = ", type(a.decode('utf-8')))
|
|
return jsonify({'code': 'SUCCESS', 'message': '成功', "data":{"a":a.decode('utf-8')}})
|
|
return jsonify({'code': 'SUCCESS', 'message': '成功'})
|
|
|
|
|
|
if __name__ == '__main__':
|
|
app.run()
|