sss
This commit is contained in:
@@ -152,21 +152,23 @@ def loginmiya():
|
||||
|
||||
@route_api.route("/member/ruilaizi",methods = [ "GET","POST" ])
|
||||
def ruilaizi():
|
||||
resp = {'code': 200, 'msg': 'r操作成功~', 'data': {}}
|
||||
req = request.values
|
||||
app.logger.info(req)
|
||||
# 文件路径 1.txt为测试文件 在项目的static/file目录下
|
||||
# 获取文件的路径和文件名
|
||||
filepath = os.path.join('static/app-release.apk')
|
||||
try:
|
||||
# 尝试打开文件并发送
|
||||
return send_file(filepath, as_attachment=True)
|
||||
except PermissionError:
|
||||
return '文件权限错误,无法访问', 403
|
||||
except Exception as e:
|
||||
return '发生错误', 500
|
||||
|
||||
return jsonify(resp)
|
||||
# resp = {'code': 200, 'msg': 'r操作成功~', 'data': {}}
|
||||
# req = request.values
|
||||
# app.logger.info(req)
|
||||
# # 文件路径 1.txt为测试文件 在项目的static/file目录下
|
||||
# # 获取文件的路径和文件名
|
||||
# filepath = os.path.join('static/app-release.apk')
|
||||
# try:
|
||||
# # 尝试打开文件并发送
|
||||
# return send_file(filepath, as_attachment=True)
|
||||
# except PermissionError:
|
||||
# return '文件权限错误,无法访问', 403
|
||||
# except Exception as e:
|
||||
# return '发生错误', 500
|
||||
#
|
||||
# return jsonify(resp)
|
||||
file_path = 'static/app-release.apk'
|
||||
return send_file(file_path, as_attachment=True)
|
||||
|
||||
@route_api.route("/member/ruilaizitest",methods = [ "GET","POST" ])
|
||||
def ruilaizitest():
|
||||
|
||||
Reference in New Issue
Block a user