Commit 18fabc6a by 赵宇

fix

parent ea425e30
......@@ -44,6 +44,7 @@ def after_request(resp):
resp.headers['Access-Control-Allow-Methods'] = 'GET,POST,OPTIONS'
return resp
# 允许的请求header示例
# 'Content-Type,Authorization,X-Requested-With,token,application/octet-stream'
# x-requested-with,content-type
......@@ -67,7 +68,8 @@ def creat_app(config_name):
# 初始化redis工具,创建Redis连接对象用于缓存
global redis_store
redis_store = redis.StrictRedis(host=config_class.REDIS_HOST, port=config_class.REDIS_PORT,password=config_class.REDIS_PASS)
redis_store = redis.StrictRedis(host=config_class.REDIS_HOST, port=config_class.REDIS_PORT,
password=config_class.REDIS_PASS)
# cors跨域插件,是否允许发送cookies
# CORS(app, supports_credentials=True)
......
......@@ -4,3 +4,4 @@ from flask import Blueprint
api_atlas = Blueprint("api_atlas", __name__)
from . import view
from . import view_es_con
......@@ -433,13 +433,16 @@ def newList():
page = req_dict.get("page")
perpage = req_dict.get("perpage")
if not all([inid, select, page, perpage]):
if not all([inid, page, perpage]):
return jsonify(code=RET.PARAMERR, msg="参数错误")
try:
enterprise = Enterprise.query.filter_by(c_type=inid)
remind = ''
if select == 1:
if select == 0:
remind = '各资质的全部企业'
enterprise = enterprise
elif select == 1:
remind = "500强企业"
enterprise = enterprise.filter_by(isfive="1")
elif select == 2: # 上市
......
......@@ -16,8 +16,8 @@ class Config:
# redis配置信息
REDIS_HOST = '127.0.0.1'
REDIS_PORT = 6379
# REDIS_PASS = "Mypwdty2020!" # TODO
REDIS_PASS = None # TODO
REDIS_PASS = "Mypwdty2020!"
# REDIS_PASS = None
# # ---------------七牛云存储------------------
# QINIU_ACCESS_KEY = '' # AK
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment