main.py 621 B

123456789101112131415161718192021222324252627282930
  1. from flask import Flask, jsonify
  2. from tag import get_FileModifyTime
  3. pad_mtime_list = []
  4. def get_modify_time():
  5. FileModifyTime = get_FileModifyTime("/data/app/pages/sagacloud-sagacare-ipad/dist")
  6. if FileModifyTime not in pad_mtime_list:
  7. pad_mtime_list.clear()
  8. pad_mtime_list.append(FileModifyTime)
  9. return FileModifyTime
  10. app = Flask(__name__)
  11. app.config["JSON_AS_ASCII"] = False # jsonify返回的中文正常显示
  12. @app.route("/pad_mtime", methods=["GET"])
  13. def get_pad_mtime():
  14. return jsonify({"pad_mtime": get_modify_time()})
  15. app.run(host="172.17.11.174",port=int("9091"))