aaaaa
This commit is contained in:
@@ -151,13 +151,13 @@ def loginmiya():
|
||||
db.session.commit()
|
||||
return jsonify(resp)
|
||||
|
||||
@route_api.route("/member/ruilaizi",methods = [ "GET" ])
|
||||
def ruilaizi():
|
||||
@route_api.route("/member/ruilaizi/<filename>",methods = [ "GET" ])
|
||||
def ruilaizi(filename):
|
||||
# version = request.args.get('version', type=str) # 获取要下载的版本号
|
||||
package_path = '/web/static/app/app.apk' # 假设更新包存放在 /path/to/update/package 目录下
|
||||
package_path = '/static/app.apk' # 假设更新包存放在 /path/to/update/package 目录下
|
||||
if os.path.exists(package_path): # 如果更新包存在
|
||||
app.logger.info(token)
|
||||
return send_from_directory(directory='/web/static/app', filename='app.apk', as_attachment=True)
|
||||
return send_from_directory(directory='static', filename=filename, as_attachment=True)
|
||||
else: # 如果更新包不存在
|
||||
return jsonify({
|
||||
'code': 404,
|
||||
@@ -169,7 +169,6 @@ def ruilaizi():
|
||||
def download(filename):
|
||||
if request.method == "GET":
|
||||
if os.path.isfile(os.path.join('static', filename)):
|
||||
app.logger.info(filename)
|
||||
return send_from_directory('static', filename, as_attachment=True)
|
||||
else: # 如果更新包不存在
|
||||
return jsonify({
|
||||
|
||||
Reference in New Issue
Block a user