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