Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mancheng
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
mancheng
Commits
18fabc6a
Commit
18fabc6a
authored
Feb 24, 2022
by
赵宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
ea425e30
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
9 deletions
+14
-9
apps/__init__.py
+5
-3
apps/view_atlas/__init__.py
+1
-0
apps/view_atlas/view_es_con.py
+0
-0
apps/view_radar/view.py
+5
-2
config.py
+3
-4
No files found.
apps/__init__.py
View file @
18fabc6a
...
@@ -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企业画像
...
...
apps/view_atlas/__init__.py
View file @
18fabc6a
...
@@ -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
apps/view_atlas/view_es_con.py
0 → 100644
View file @
18fabc6a
This diff is collapsed.
Click to expand it.
apps/view_radar/view.py
View file @
18fabc6a
...
@@ -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
:
# 上市
...
...
config.py
View file @
18fabc6a
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment