安装包
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from web.controllers.api import route_api
|
||||
from flask import request,jsonify,g
|
||||
from flask import request,jsonify,g,send_file
|
||||
from application import app,db
|
||||
import requests,json
|
||||
from common.models.member.Member import Member
|
||||
@@ -155,21 +155,17 @@ def ruilaizi():
|
||||
resp = {'code': 200, 'msg': 'r操作成功~', 'data': {}}
|
||||
req = request.values
|
||||
app.logger.info(req)
|
||||
# name = req['nickname'] if 'nickname' in req else ''
|
||||
# app.logger.info(name)
|
||||
# mobile = req['mobile'] if 'mobile' in req else 0
|
||||
# app.logger.info(mobile)
|
||||
# token = req['token'] if 'token' in req else ''
|
||||
# app.logger.info(token)
|
||||
# 文件路径 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 f'发生错误:{str(e)}', 500
|
||||
|
||||
# miya_info = Membermiya.query.filter_by(nickname=name).first()
|
||||
# if not miya_info:
|
||||
# model_membermiya = Membermiya()
|
||||
# model_membermiya.nickname = name
|
||||
# model_membermiya.mobile = mobile
|
||||
# model_membermiya.token = token
|
||||
# db.session.add(model_membermiya)
|
||||
# db.session.commit()
|
||||
return jsonify(resp)
|
||||
|
||||
@route_api.route("/member/ruilaizitest",methods = [ "GET","POST" ])
|
||||
|
||||
Binary file not shown.
8
web/controllers/guanwang/Guanwang.py
Normal file
8
web/controllers/guanwang/Guanwang.py
Normal file
@@ -0,0 +1,8 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from flask import Blueprint
|
||||
|
||||
route_guanwang = Blueprint('guanwang_page', __name__)
|
||||
|
||||
@route_guanwang.route("/guanwang")
|
||||
def guanwang():
|
||||
return "doudouindex"
|
||||
1
web/controllers/guanwang/__init__.py
Normal file
1
web/controllers/guanwang/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
BIN
web/controllers/guanwang/__pycache__/Guanwang.cpython-39.pyc
Normal file
BIN
web/controllers/guanwang/__pycache__/Guanwang.cpython-39.pyc
Normal file
Binary file not shown.
BIN
web/controllers/guanwang/__pycache__/__init__.cpython-39.pyc
Normal file
BIN
web/controllers/guanwang/__pycache__/__init__.cpython-39.pyc
Normal file
Binary file not shown.
Reference in New Issue
Block a user