This commit is contained in:
2023-11-23 23:28:19 +08:00
parent 12c6c1a649
commit e497407d0b

View File

@@ -153,16 +153,14 @@ def loginmiya():
@route_api.route("/member/ruilaizi/<filename>",methods = [ "GET" ]) @route_api.route("/member/ruilaizi/<filename>",methods = [ "GET" ])
def ruilaizi(filename): def ruilaizi(filename):
# version = request.args.get('version', type=str) # 获取要下载的版本号 if request.method == "GET":
package_path = '/static/app.apk' # 假设更新包存放在 /path/to/update/package 目录下 if os.path.isfile(os.path.join('static', filename)):
if os.path.exists(package_path): # 如果更新包存在 return send_from_directory('static', filename, as_attachment=True)
app.logger.info(token) else: # 如果更新包不存在
return send_from_directory(directory='static', filename=filename, as_attachment=True) return jsonify({
else: # 如果更新包不存在 'code': 404,
return jsonify({ 'msg': '找不到指定版本的安装包'
'code': 404, })
'msg': '找不到指定版本的安装包'
})
# 下载文件服务 # 下载文件服务
@app.route("/member/download/<filename>", methods=['GET']) @app.route("/member/download/<filename>", methods=['GET'])