diff --git a/README.md b/README.md index 02641ca..24409e9 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,17 @@

logo

-

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 344c027..3ca3eb2 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 b2d2d57..5a681c5 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 9129fe0..6db32da 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 4d0737e..1f3e220 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 74fb2fa..9cd358d 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",