from flask import Flask, jsonify from tag import get_FileModifyTime pad_mtime_list = [] def get_modify_time(): FileModifyTime = get_FileModifyTime("/data/app/pages/sagacloud-sagacare-ipad/dist") if FileModifyTime not in pad_mtime_list: pad_mtime_list.clear() pad_mtime_list.append(FileModifyTime) return FileModifyTime app = Flask(__name__) app.config["JSON_AS_ASCII"] = False # jsonify返回的中文正常显示 @app.route("/pad_mtime", methods=["GET"]) def get_pad_mtime(): return jsonify({"pad_mtime": get_modify_time()}) app.run(host="172.17.11.174",port=int("9091"))