Skip to content

Commit 5b380a4

Browse files
insistencegitee-org
authored andcommitted
!30 Dash-FastAPI-Admin v2.0.1
Merge pull request !30 from insistence/develop
2 parents 8719ced + b831992 commit 5b380a4

File tree

9 files changed

+51
-7
lines changed

9 files changed

+51
-7
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<p align="center">
22
<img alt="logo" src="https://oscimg.oschina.net/oscnet/up-d3d0a9303e11d522a06cd263f3079027715.png">
33
</p>
4-
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">Dash-FastAPI-Admin v2.0.0</h1>
4+
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">Dash-FastAPI-Admin v2.0.1</h1>
55
<h4 align="center">基于Dash+FastAPI前后端分离的纯Python快速开发框架</h4>
66
<p align="center">
77
<a href="https://gitee.com/insistence2022/dash-fastapi-admin/stargazers"><img src="https://gitee.com/insistence2022/dash-fastapi-admin/badge/star.svg?theme=dark"></a>
88
<a href="https://github.com/insistence/Dash-FastAPI-Admin"><img src="https://img.shields.io/github/stars/insistence/Dash-FastAPI-Admin?style=social"></a>
9-
<a href="https://gitee.com/insistence2022/dash-fastapi-admin"><img src="https://img.shields.io/badge/DashFastAPIAdmin-v2.0.0-brightgreen.svg"></a>
9+
<a href="https://gitee.com/insistence2022/dash-fastapi-admin"><img src="https://img.shields.io/badge/DashFastAPIAdmin-v2.0.1-brightgreen.svg"></a>
1010
<a href="https://gitee.com/insistence2022/dash-fastapi-admin/blob/master/LICENSE"><img src="https://img.shields.io/github/license/mashape/apistatus.svg"></a>
1111
<img src="https://img.shields.io/badge/python-≥3.9-blue">
1212
<img src="https://img.shields.io/badge/MySQL-≥5.7-blue">

dash-fastapi-backend/.env.dev

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ APP_HOST = '0.0.0.0'
1010
# 应用端口
1111
APP_PORT = 9099
1212
# 应用版本
13-
APP_VERSION= '2.0.0'
13+
APP_VERSION= '2.0.1'
1414
# 应用是否开启热重载
1515
APP_RELOAD = true
1616
# 应用是否开启IP归属区域查询

dash-fastapi-backend/.env.prod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ APP_HOST = '0.0.0.0'
1010
# 应用端口
1111
APP_PORT = 9099
1212
# 应用版本
13-
APP_VERSION= '2.0.0'
13+
APP_VERSION= '2.0.1'
1414
# 应用是否开启热重载
1515
APP_RELOAD = false
1616
# 应用是否开启IP归属区域查询

dash-fastapi-frontend/.env.dev

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ APP_SECRET_KEY = 'Dash-FastAPI-Admin'
1515
APP_HOST = '0.0.0.0'
1616
# 应用端口
1717
APP_PORT = 8088
18+
# 应用版本
19+
APP_VERSION= '2.0.1'
1820
# 应用是否开启debug模式
1921
APP_DEBUG = true
2022
# flask-compress压缩配置

dash-fastapi-frontend/.env.prod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ APP_SECRET_KEY = 'Dash-FastAPI-Admin'
1515
APP_HOST = '0.0.0.0'
1616
# 应用端口
1717
APP_PORT = 8088
18+
# 应用版本
19+
APP_VERSION= '2.0.1'
1820
# 应用是否开启debug模式
1921
APP_DEBUG = false
2022
# flask-compress压缩配置

dash-fastapi-frontend/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def get_user_agent_info():
4646
'用户使用IE内核',
4747
)
4848
return "<h1 style='color: red'>请不要使用IE浏览器或360浏览器兼容模式</h1>"
49-
if bw_version < 71:
49+
if bw == 'Chrome' and bw_version < 71:
5050
logger.warning(
5151
'[sys]请求人:{}||请求IP:{}||请求方法:{}||请求Data:{}',
5252
session.get('name'),

dash-fastapi-frontend/utils/common_util.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,32 @@
1+
from copy import deepcopy
12
from typing import Dict, List, Union
23

34

5+
class FilterUtil:
6+
"""
7+
过滤工具类
8+
"""
9+
10+
@classmethod
11+
def fliter_params(cls, params_name: Union[str, List[str]], fliter_dict: Dict):
12+
"""
13+
过滤字典数据中指定名称的参数
14+
15+
:param params_name: 需要过滤的参数名称
16+
:param fliter_dict: 需要过滤的字典数据
17+
:return: 过滤后的字典数据
18+
"""
19+
copy_dict = deepcopy(fliter_dict)
20+
if isinstance(params_name, str) and params_name in copy_dict:
21+
copy_dict.pop(params_name)
22+
elif isinstance(params_name, list):
23+
for name in params_name:
24+
if name in copy_dict:
25+
copy_dict.pop(name)
26+
27+
return copy_dict
28+
29+
430
class ValidateUtil:
531
"""
632
校验工具类

dash-fastapi-frontend/utils/request.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
ServiceWarning,
1212
)
1313
from utils.cache_util import CacheManager
14+
from utils.common_util import FilterUtil
1415
from utils.log_util import logger
1516

1617

@@ -127,7 +128,18 @@ def api_request(
127128
if CacheManager.get('user_info')
128129
else None
129130
)
130-
request_params = ','.join([str(x) for x in data_list if x])
131+
request_params = ','.join(
132+
[
133+
str(
134+
FilterUtil.fliter_params(
135+
params_name=['password', 'old_password', 'new_password'],
136+
fliter_dict=x,
137+
)
138+
)
139+
for x in data_list
140+
if x
141+
]
142+
)
131143
log_message = LogMessage(
132144
request_user,
133145
remote_addr,

dash-fastapi-frontend/wsgi.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,7 @@
55
serve(
66
app.server,
77
host=AppConfig.app_host,
8-
port=AppConfig.app_port
8+
port=AppConfig.app_port,
9+
trusted_proxy='*',
10+
trusted_proxy_headers='x-forwarded-for',
911
)

0 commit comments

Comments
 (0)