diff --git a/README.md b/README.md
index 02641ca889dce37e45f0bc79cb694e079296ef32..24409e94d70e0b0c3a7e9afe96c63f2619c7e0cb 100644
--- a/README.md
+++ b/README.md
@@ -1,22 +1,17 @@
-RuoYi-Vue3-FastAPI v1.3.0
+RuoYi-Vue3-FastAPI v1.3.1
基于RuoYi-Vue3+FastAPI前后端分离的快速开发框架
-
+
-
+
-
-
-
-
-
## 平台简介
RuoYi-Vue3-FastAPI是一套全部开源的快速开发平台,毫无保留给个人及企业免费使用。
diff --git a/ruoyi-fastapi-backend/.env.dev b/ruoyi-fastapi-backend/.env.dev
index 344c0274dd536f5b5cc046eaa5de5900844e946a..3ca3eb2abad875555973d0714e05e890d39cbc85 100644
--- a/ruoyi-fastapi-backend/.env.dev
+++ b/ruoyi-fastapi-backend/.env.dev
@@ -10,7 +10,7 @@ APP_HOST = '0.0.0.0'
# 应用端口
APP_PORT = 9099
# 应用版本
-APP_VERSION= '1.3.0'
+APP_VERSION= '1.3.1'
# 应用是否开启热重载
APP_RELOAD = true
# 应用是否开启IP归属区域查询
diff --git a/ruoyi-fastapi-backend/.env.prod b/ruoyi-fastapi-backend/.env.prod
index b2d2d579e440f21899f21c52ea996ceb6158d8bd..5a681c581ff1f422cc404992c3148be62773786f 100644
--- a/ruoyi-fastapi-backend/.env.prod
+++ b/ruoyi-fastapi-backend/.env.prod
@@ -10,7 +10,7 @@ APP_HOST = '0.0.0.0'
# 应用端口
APP_PORT = 9099
# 应用版本
-APP_VERSION= '1.3.0'
+APP_VERSION= '1.3.1'
# 应用是否开启热重载
APP_RELOAD = false
# 应用是否开启IP归属区域查询
diff --git a/ruoyi-fastapi-backend/config/constant.py b/ruoyi-fastapi-backend/config/constant.py
index 9129fe06ef5afecf0a7cd6f03f618af7d9b6e94e..6db32dad38752eb48024d794cecf763008e75453 100644
--- a/ruoyi-fastapi-backend/config/constant.py
+++ b/ruoyi-fastapi-backend/config/constant.py
@@ -76,7 +76,7 @@ class JobConstant:
"""
定时任务常量
- JOB_ERROR_LIST: 定时任务禁止调用模块列表
+ JOB_ERROR_LIST: 定时任务禁止调用模块及违规字符串列表
JOB_WHITE_LIST: 定时任务允许调用模块列表
"""
@@ -84,11 +84,46 @@ class JobConstant:
'app',
'config',
'exceptions',
+ 'import ',
'middlewares',
'module_admin',
+ 'open(',
+ 'os.',
'server',
'sub_applications',
+ 'subprocess.',
+ 'sys.',
'utils',
+ 'while ',
+ '__import__',
+ '"',
+ "'",
+ ',',
+ '?',
+ ':',
+ ';',
+ '/',
+ '|',
+ '+',
+ '-',
+ '=',
+ '~',
+ '!',
+ '#',
+ '$',
+ '%',
+ '^',
+ '&',
+ '*',
+ '<',
+ '>',
+ '(',
+ ')',
+ '[',
+ ']',
+ '{',
+ '}',
+ ' ',
]
JOB_WHITE_LIST = ['module_task']
diff --git a/ruoyi-fastapi-backend/module_admin/annotation/log_annotation.py b/ruoyi-fastapi-backend/module_admin/annotation/log_annotation.py
index 4d0737e280b7bfee4bd7546458acac3fd5f2e7f1..1f3e220227f9de4b80498405ba9fce2c3b1bba26 100644
--- a/ruoyi-fastapi-backend/module_admin/annotation/log_annotation.py
+++ b/ruoyi-fastapi-backend/module_admin/annotation/log_annotation.py
@@ -15,6 +15,8 @@ from module_admin.service.log_service import LoginLogService, OperationLogServic
from module_admin.service.login_service import LoginService
from config.enums import BusinessType
from config.env import AppConfig
+from exceptions.exception import LoginException, ServiceException, ServiceWarning
+from utils.response_util import ResponseUtil
class Log:
@@ -111,8 +113,17 @@ class Log:
loginTime=oper_time.strftime('%Y-%m-%d %H:%M:%S'),
)
kwargs['form_data'].login_info = login_log
- # 调用原始函数
- result = await func(*args, **kwargs)
+ try:
+ # 调用原始函数
+ result = await func(*args, **kwargs)
+ except LoginException as e:
+ result = ResponseUtil.failure(data=e.data, msg=e.message)
+ except ServiceException as e:
+ result = ResponseUtil.error(data=e.data, msg=e.message)
+ except ServiceWarning as e:
+ result = ResponseUtil.failure(data=e.data, msg=e.message)
+ except Exception as e:
+ result = ResponseUtil.error(msg=str(e))
# 获取请求耗时
cost_time = float(time.time() - start_time) * 100
# 判断请求是否来自api文档
@@ -281,8 +292,17 @@ def log_decorator(
loginTime=oper_time.strftime('%Y-%m-%d %H:%M:%S'),
)
kwargs['form_data'].login_info = login_log
- # 调用原始函数
- result = await func(*args, **kwargs)
+ try:
+ # 调用原始函数
+ result = await func(*args, **kwargs)
+ except LoginException as e:
+ result = ResponseUtil.failure(data=e.data, msg=e.message)
+ except ServiceException as e:
+ result = ResponseUtil.error(data=e.data, msg=e.message)
+ except ServiceWarning as e:
+ result = ResponseUtil.failure(data=e.data, msg=e.message)
+ except Exception as e:
+ result = ResponseUtil.error(msg=str(e))
# 获取请求耗时
cost_time = float(time.time() - start_time) * 100
# 判断请求是否来自api文档
diff --git a/ruoyi-fastapi-frontend/package.json b/ruoyi-fastapi-frontend/package.json
index 74fb2fa5c958d074b82457c2842ff0b8c86fe90f..9cd358d511c8ab45763c13fb224cd288503b69da 100644
--- a/ruoyi-fastapi-frontend/package.json
+++ b/ruoyi-fastapi-frontend/package.json
@@ -1,6 +1,6 @@
{
"name": "vfadmin",
- "version": "1.3.0",
+ "version": "1.3.1",
"description": "vfadmin管理系统",
"author": "insistence",
"license": "MIT",