Skip to content

Commit 9a31c21

Browse files
insistencegitee-org
authored andcommitted
!15 RuoYi-Vue3-FastAPI v1.3.1
Merge pull request !15 from insistence/develop
2 parents d55ddbe + e52f0f4 commit 9a31c21

File tree

6 files changed

+66
-16
lines changed

6 files changed

+66
-16
lines changed

README.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
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;">RuoYi-Vue3-FastAPI v1.3.0</h1>
4+
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">RuoYi-Vue3-FastAPI v1.3.1</h1>
55
<h4 align="center">基于RuoYi-Vue3+FastAPI前后端分离的快速开发框架</h4>
66
<p align="center">
77
<a href="https://gitee.com/insistence2022/RuoYi-Vue3-FastAPI/stargazers"><img src="https://gitee.com/insistence2022/RuoYi-Vue3-FastAPI/badge/star.svg?theme=dark"></a>
88
<a href="https://github.com/insistence/RuoYi-Vue3-FastAPI"><img src="https://img.shields.io/github/stars/insistence/RuoYi-Vue3-FastAPI?style=social"></a>
9-
<a href="https://gitee.com/insistence2022/RuoYi-Vue3-FastAPI"><img src="https://img.shields.io/badge/RuoYiVue3FastAPI-v1.3.0-brightgreen.svg"></a>
9+
<a href="https://gitee.com/insistence2022/RuoYi-Vue3-FastAPI"><img src="https://img.shields.io/badge/RuoYiVue3FastAPI-v1.3.1-brightgreen.svg"></a>
1010
<a href="https://gitee.com/insistence2022/RuoYi-Vue3-FastAPI/blob/master/LICENSE"><img src="https://img.shields.io/github/license/mashape/apistatus.svg"></a>
11-
<img src="https://img.shields.io/badge/python-≥3.8-blue">
11+
<img src="https://img.shields.io/badge/python-≥3.9-blue">
1212
<img src="https://img.shields.io/badge/MySQL-≥5.7-blue">
1313
</p>
1414

15-
16-
17-
18-
19-
2015
## 平台简介
2116

2217
RuoYi-Vue3-FastAPI是一套全部开源的快速开发平台,毫无保留给个人及企业免费使用。

ruoyi-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= '1.3.0'
13+
APP_VERSION= '1.3.1'
1414
# 应用是否开启热重载
1515
APP_RELOAD = true
1616
# 应用是否开启IP归属区域查询

ruoyi-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= '1.3.0'
13+
APP_VERSION= '1.3.1'
1414
# 应用是否开启热重载
1515
APP_RELOAD = false
1616
# 应用是否开启IP归属区域查询

ruoyi-fastapi-backend/config/constant.py

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,19 +76,54 @@ class JobConstant:
7676
"""
7777
定时任务常量
7878
79-
JOB_ERROR_LIST: 定时任务禁止调用模块列表
79+
JOB_ERROR_LIST: 定时任务禁止调用模块及违规字符串列表
8080
JOB_WHITE_LIST: 定时任务允许调用模块列表
8181
"""
8282

8383
JOB_ERROR_LIST = [
8484
'app',
8585
'config',
8686
'exceptions',
87+
'import ',
8788
'middlewares',
8889
'module_admin',
90+
'open(',
91+
'os.',
8992
'server',
9093
'sub_applications',
94+
'subprocess.',
95+
'sys.',
9196
'utils',
97+
'while ',
98+
'__import__',
99+
'"',
100+
"'",
101+
',',
102+
'?',
103+
':',
104+
';',
105+
'/',
106+
'|',
107+
'+',
108+
'-',
109+
'=',
110+
'~',
111+
'!',
112+
'#',
113+
'$',
114+
'%',
115+
'^',
116+
'&',
117+
'*',
118+
'<',
119+
'>',
120+
'(',
121+
')',
122+
'[',
123+
']',
124+
'{',
125+
'}',
126+
' ',
92127
]
93128
JOB_WHITE_LIST = ['module_task']
94129

ruoyi-fastapi-backend/module_admin/annotation/log_annotation.py

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
from module_admin.service.login_service import LoginService
1616
from config.enums import BusinessType
1717
from config.env import AppConfig
18+
from exceptions.exception import LoginException, ServiceException, ServiceWarning
19+
from utils.response_util import ResponseUtil
1820

1921

2022
class Log:
@@ -111,8 +113,17 @@ async def wrapper(*args, **kwargs):
111113
loginTime=oper_time.strftime('%Y-%m-%d %H:%M:%S'),
112114
)
113115
kwargs['form_data'].login_info = login_log
114-
# 调用原始函数
115-
result = await func(*args, **kwargs)
116+
try:
117+
# 调用原始函数
118+
result = await func(*args, **kwargs)
119+
except LoginException as e:
120+
result = ResponseUtil.failure(data=e.data, msg=e.message)
121+
except ServiceException as e:
122+
result = ResponseUtil.error(data=e.data, msg=e.message)
123+
except ServiceWarning as e:
124+
result = ResponseUtil.failure(data=e.data, msg=e.message)
125+
except Exception as e:
126+
result = ResponseUtil.error(msg=str(e))
116127
# 获取请求耗时
117128
cost_time = float(time.time() - start_time) * 100
118129
# 判断请求是否来自api文档
@@ -281,8 +292,17 @@ async def wrapper(*args, **kwargs):
281292
loginTime=oper_time.strftime('%Y-%m-%d %H:%M:%S'),
282293
)
283294
kwargs['form_data'].login_info = login_log
284-
# 调用原始函数
285-
result = await func(*args, **kwargs)
295+
try:
296+
# 调用原始函数
297+
result = await func(*args, **kwargs)
298+
except LoginException as e:
299+
result = ResponseUtil.failure(data=e.data, msg=e.message)
300+
except ServiceException as e:
301+
result = ResponseUtil.error(data=e.data, msg=e.message)
302+
except ServiceWarning as e:
303+
result = ResponseUtil.failure(data=e.data, msg=e.message)
304+
except Exception as e:
305+
result = ResponseUtil.error(msg=str(e))
286306
# 获取请求耗时
287307
cost_time = float(time.time() - start_time) * 100
288308
# 判断请求是否来自api文档

ruoyi-fastapi-frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vfadmin",
3-
"version": "1.3.0",
3+
"version": "1.3.1",
44
"description": "vfadmin管理系统",
55
"author": "insistence",
66
"license": "MIT",

0 commit comments

Comments
 (0)