Commit 18fabc6a by 赵宇

fix

parent ea425e30
...@@ -40,10 +40,11 @@ def after_request(resp): ...@@ -40,10 +40,11 @@ def after_request(resp):
resp.headers['Access-Control-Allow-Origin'] = '*' resp.headers['Access-Control-Allow-Origin'] = '*'
resp.headers['Access-Control-Allow-Credentials'] = 'TRUE' resp.headers['Access-Control-Allow-Credentials'] = 'TRUE'
resp.headers[ resp.headers[
'Access-Control-Allow-Headers'] = 'x-requested-with,content-type,token' # 允许的请求header 'Access-Control-Allow-Headers'] = 'x-requested-with,content-type,token' # 允许的请求header
resp.headers['Access-Control-Allow-Methods'] = 'GET,POST,OPTIONS' resp.headers['Access-Control-Allow-Methods'] = 'GET,POST,OPTIONS'
return resp return resp
# 允许的请求header示例 # 允许的请求header示例
# 'Content-Type,Authorization,X-Requested-With,token,application/octet-stream' # 'Content-Type,Authorization,X-Requested-With,token,application/octet-stream'
# x-requested-with,content-type # x-requested-with,content-type
...@@ -67,7 +68,8 @@ def creat_app(config_name): ...@@ -67,7 +68,8 @@ def creat_app(config_name):
# 初始化redis工具,创建Redis连接对象用于缓存 # 初始化redis工具,创建Redis连接对象用于缓存
global redis_store 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跨域插件,是否允许发送cookies
# CORS(app, supports_credentials=True) # CORS(app, supports_credentials=True)
...@@ -101,7 +103,7 @@ def creat_app(config_name): ...@@ -101,7 +103,7 @@ def creat_app(config_name):
# app.register_blueprint(api_user, url_prefix='/api/user') # app.register_blueprint(api_user, url_prefix='/api/user')
app.register_blueprint(api_radar, url_prefix='/api/radar') # 产业招商雷达 app.register_blueprint(api_radar, url_prefix='/api/radar') # 产业招商雷达
app.register_blueprint(api_atlas, url_prefix='/api/atlas') # 产业现状图谱 app.register_blueprint(api_atlas, url_prefix='/api/atlas') # 产业现状图谱
app.register_blueprint(api_map, url_prefix='/api/map') # 产业招商地图 app.register_blueprint(api_map, url_prefix='/api/map') # 产业招商地图
app.register_blueprint(api_attract, url_prefix='/api/attract/industry') # 招商驾驶舱 app.register_blueprint(api_attract, url_prefix='/api/attract/industry') # 招商驾驶舱
app.register_blueprint(api_portraits, url_prefix="/api/360company") # 360企业画像 app.register_blueprint(api_portraits, url_prefix="/api/360company") # 360企业画像
......
...@@ -4,3 +4,4 @@ from flask import Blueprint ...@@ -4,3 +4,4 @@ from flask import Blueprint
api_atlas = Blueprint("api_atlas", __name__) api_atlas = Blueprint("api_atlas", __name__)
from . import view from . import view
from . import view_es_con
...@@ -433,13 +433,16 @@ def newList(): ...@@ -433,13 +433,16 @@ def newList():
page = req_dict.get("page") page = req_dict.get("page")
perpage = req_dict.get("perpage") perpage = req_dict.get("perpage")
if not all([inid, select, page, perpage]): if not all([inid, page, perpage]):
return jsonify(code=RET.PARAMERR, msg="参数错误") return jsonify(code=RET.PARAMERR, msg="参数错误")
try: try:
enterprise = Enterprise.query.filter_by(c_type=inid) enterprise = Enterprise.query.filter_by(c_type=inid)
remind = '' remind = ''
if select == 1: if select == 0:
remind = '各资质的全部企业'
enterprise = enterprise
elif select == 1:
remind = "500强企业" remind = "500强企业"
enterprise = enterprise.filter_by(isfive="1") enterprise = enterprise.filter_by(isfive="1")
elif select == 2: # 上市 elif select == 2: # 上市
......
...@@ -16,8 +16,8 @@ class Config: ...@@ -16,8 +16,8 @@ class Config:
# redis配置信息 # redis配置信息
REDIS_HOST = '127.0.0.1' REDIS_HOST = '127.0.0.1'
REDIS_PORT = 6379 REDIS_PORT = 6379
# REDIS_PASS = "Mypwdty2020!" # TODO REDIS_PASS = "Mypwdty2020!"
REDIS_PASS = None # TODO # REDIS_PASS = None
# # ---------------七牛云存储------------------ # # ---------------七牛云存储------------------
# QINIU_ACCESS_KEY = '' # AK # QINIU_ACCESS_KEY = '' # AK
...@@ -66,4 +66,4 @@ class ProductionConfig(Config): ...@@ -66,4 +66,4 @@ class ProductionConfig(Config):
config_map = { config_map = {
# 'develop': DevelopmentConfig, # 'develop': DevelopmentConfig,
'product': ProductionConfig, 'product': ProductionConfig,
} }
\ No newline at end of file
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