From 212a96358ce78fe8ae1060481e770e59d30aaa97 Mon Sep 17 00:00:00 2001
From: insistence <3055204202@qq.com>
Date: Tue, 8 Oct 2024 10:51:30 +0800
Subject: [PATCH 1/5] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dwaitress=203.0.0?=
=?UTF-8?q?=E7=89=88=E6=9C=AC=E8=8E=B7=E5=8F=96=E4=BB=A3=E7=90=86IP?=
=?UTF-8?q?=E5=BC=82=E5=B8=B8=E7=9A=84=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
dash-fastapi-frontend/wsgi.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/dash-fastapi-frontend/wsgi.py b/dash-fastapi-frontend/wsgi.py
index 4e50b77..8bf1713 100644
--- a/dash-fastapi-frontend/wsgi.py
+++ b/dash-fastapi-frontend/wsgi.py
@@ -5,5 +5,7 @@ from config.env import AppConfig
serve(
app.server,
host=AppConfig.app_host,
- port=AppConfig.app_port
+ port=AppConfig.app_port,
+ trusted_proxy='*',
+ trusted_proxy_headers='x-forwarded-for',
)
--
Gitee
From 25ff1d3890fde041adbc812d76addf512bbf12bf Mon Sep 17 00:00:00 2001
From: insistence <3055204202@qq.com>
Date: Tue, 8 Oct 2024 10:52:28 +0800
Subject: [PATCH 2/5] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=BC=82=E5=B8=B8?=
=?UTF-8?q?=E6=8B=A6=E6=88=AA=E9=9D=9EChrome=E5=86=85=E6=A0=B8=E6=B5=8F?=
=?UTF-8?q?=E8=A7=88=E5=99=A8=E8=AF=B7=E6=B1=82=E7=9A=84=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
dash-fastapi-frontend/server.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dash-fastapi-frontend/server.py b/dash-fastapi-frontend/server.py
index 853fe10..e1bca53 100644
--- a/dash-fastapi-frontend/server.py
+++ b/dash-fastapi-frontend/server.py
@@ -46,7 +46,7 @@ def get_user_agent_info():
'用户使用IE内核',
)
return "
请不要使用IE浏览器或360浏览器兼容模式
"
- if bw_version < 71:
+ if bw == 'Chrome' and bw_version < 71:
logger.warning(
'[sys]请求人:{}||请求IP:{}||请求方法:{}||请求Data:{}',
session.get('name'),
--
Gitee
From 60a186f7a3a25c62dda6cdd41167a628c8881859 Mon Sep 17 00:00:00 2001
From: insistence <3055204202@qq.com>
Date: Tue, 8 Oct 2024 21:46:27 +0800
Subject: [PATCH 3/5] =?UTF-8?q?perf:=20=E5=89=8D=E7=AB=AF=E6=97=A5?=
=?UTF-8?q?=E5=BF=97=E8=AE=B0=E5=BD=95=E8=87=AA=E5=8A=A8=E6=8E=92=E9=99=A4?=
=?UTF-8?q?password=E7=B1=BB=E5=AD=97=E6=AE=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
dash-fastapi-frontend/utils/common_util.py | 26 ++++++++++++++++++++++
dash-fastapi-frontend/utils/request.py | 14 +++++++++++-
2 files changed, 39 insertions(+), 1 deletion(-)
diff --git a/dash-fastapi-frontend/utils/common_util.py b/dash-fastapi-frontend/utils/common_util.py
index c7c80db..0dfae70 100644
--- a/dash-fastapi-frontend/utils/common_util.py
+++ b/dash-fastapi-frontend/utils/common_util.py
@@ -1,6 +1,32 @@
+from copy import deepcopy
from typing import Dict, List, Union
+class FilterUtil:
+ """
+ 过滤工具类
+ """
+
+ @classmethod
+ def fliter_params(cls, params_name: Union[str, List[str]], fliter_dict: Dict):
+ """
+ 过滤字典数据中指定名称的参数
+
+ :param params_name: 需要过滤的参数名称
+ :param fliter_dict: 需要过滤的字典数据
+ :return: 过滤后的字典数据
+ """
+ copy_dict = deepcopy(fliter_dict)
+ if isinstance(params_name, str) and params_name in copy_dict:
+ copy_dict.pop(params_name)
+ elif isinstance(params_name, list):
+ for name in params_name:
+ if name in copy_dict:
+ copy_dict.pop(name)
+
+ return copy_dict
+
+
class ValidateUtil:
"""
校验工具类
diff --git a/dash-fastapi-frontend/utils/request.py b/dash-fastapi-frontend/utils/request.py
index 4ad69d6..684c209 100644
--- a/dash-fastapi-frontend/utils/request.py
+++ b/dash-fastapi-frontend/utils/request.py
@@ -11,6 +11,7 @@ from config.exception import (
ServiceWarning,
)
from utils.cache_util import CacheManager
+from utils.common_util import FilterUtil
from utils.log_util import logger
@@ -127,7 +128,18 @@ def api_request(
if CacheManager.get('user_info')
else None
)
- request_params = ','.join([str(x) for x in data_list if x])
+ request_params = ','.join(
+ [
+ str(
+ FilterUtil.fliter_params(
+ params_name=['password', 'old_password', 'new_password'],
+ fliter_dict=x,
+ )
+ )
+ for x in data_list
+ if x
+ ]
+ )
log_message = LogMessage(
request_user,
remote_addr,
--
Gitee
From 3079c19fe3718927fb57efe55be8bd816ca8107e Mon Sep 17 00:00:00 2001
From: insistence <3055204202@qq.com>
Date: Sun, 13 Oct 2024 19:52:21 +0800
Subject: [PATCH 4/5] =?UTF-8?q?chore:=20=E5=8D=87=E7=BA=A7=E7=89=88?=
=?UTF-8?q?=E6=9C=AC=E8=87=B32.0.1?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
dash-fastapi-backend/.env.dev | 2 +-
dash-fastapi-backend/.env.prod | 2 +-
dash-fastapi-frontend/.env.dev | 2 ++
dash-fastapi-frontend/.env.prod | 2 ++
4 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/dash-fastapi-backend/.env.dev b/dash-fastapi-backend/.env.dev
index 931468f..67e44f0 100644
--- a/dash-fastapi-backend/.env.dev
+++ b/dash-fastapi-backend/.env.dev
@@ -10,7 +10,7 @@ APP_HOST = '0.0.0.0'
# 应用端口
APP_PORT = 9099
# 应用版本
-APP_VERSION= '2.0.0'
+APP_VERSION= '2.0.1'
# 应用是否开启热重载
APP_RELOAD = true
# 应用是否开启IP归属区域查询
diff --git a/dash-fastapi-backend/.env.prod b/dash-fastapi-backend/.env.prod
index c812b1d..545c3db 100644
--- a/dash-fastapi-backend/.env.prod
+++ b/dash-fastapi-backend/.env.prod
@@ -10,7 +10,7 @@ APP_HOST = '0.0.0.0'
# 应用端口
APP_PORT = 9099
# 应用版本
-APP_VERSION= '2.0.0'
+APP_VERSION= '2.0.1'
# 应用是否开启热重载
APP_RELOAD = false
# 应用是否开启IP归属区域查询
diff --git a/dash-fastapi-frontend/.env.dev b/dash-fastapi-frontend/.env.dev
index ee7e0e7..876a5a5 100644
--- a/dash-fastapi-frontend/.env.dev
+++ b/dash-fastapi-frontend/.env.dev
@@ -15,6 +15,8 @@ APP_SECRET_KEY = 'Dash-FastAPI-Admin'
APP_HOST = '0.0.0.0'
# 应用端口
APP_PORT = 8088
+# 应用版本
+APP_VERSION= '2.0.1'
# 应用是否开启debug模式
APP_DEBUG = true
# flask-compress压缩配置
diff --git a/dash-fastapi-frontend/.env.prod b/dash-fastapi-frontend/.env.prod
index cf86c04..4cbc4fa 100644
--- a/dash-fastapi-frontend/.env.prod
+++ b/dash-fastapi-frontend/.env.prod
@@ -15,6 +15,8 @@ APP_SECRET_KEY = 'Dash-FastAPI-Admin'
APP_HOST = '0.0.0.0'
# 应用端口
APP_PORT = 8088
+# 应用版本
+APP_VERSION= '2.0.1'
# 应用是否开启debug模式
APP_DEBUG = false
# flask-compress压缩配置
--
Gitee
From b831992c69dc40ffeb0fa67f216d65ca8b91e5d0 Mon Sep 17 00:00:00 2001
From: insistence <3055204202@qq.com>
Date: Sun, 13 Oct 2024 19:53:04 +0800
Subject: [PATCH 5/5] =?UTF-8?q?docs:=20=E6=9B=B4=E6=96=B0README=E6=96=87?=
=?UTF-8?q?=E6=A1=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 38d2f84..2f3bf00 100644
--- a/README.md
+++ b/README.md
@@ -1,12 +1,12 @@
-Dash-FastAPI-Admin v2.0.0
+Dash-FastAPI-Admin v2.0.1
基于Dash+FastAPI前后端分离的纯Python快速开发框架
-
+
--
Gitee