Skip to content

Commit 84a02a4

Browse files
insistencegitee-org
authored andcommitted
!17 RuoYi-Vue3-FastAPI v1.3.3
Merge pull request !17 from insistence/develop
2 parents c415dfa + c750908 commit 84a02a4

File tree

8 files changed

+23
-20
lines changed

8 files changed

+23
-20
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;">RuoYi-Vue3-FastAPI v1.3.2</h1>
4+
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">RuoYi-Vue3-FastAPI v1.3.3</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.2-brightgreen.svg"></a>
9+
<a href="https://gitee.com/insistence2022/RuoYi-Vue3-FastAPI"><img src="https://img.shields.io/badge/RuoYiVue3FastAPI-v1.3.3-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>
1111
<img src="https://img.shields.io/badge/python-≥3.9-blue">
1212
<img src="https://img.shields.io/badge/MySQL-≥5.7-blue">

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

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

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from config.enums import BusinessType
1717
from config.env import AppConfig
1818
from exceptions.exception import LoginException, ServiceException, ServiceWarning
19+
from utils.log_util import logger
1920
from utils.response_util import ResponseUtil
2021

2122

@@ -116,13 +117,14 @@ async def wrapper(*args, **kwargs):
116117
try:
117118
# 调用原始函数
118119
result = await func(*args, **kwargs)
119-
except LoginException as e:
120+
except (LoginException, ServiceWarning) as e:
121+
logger.warning(e.message)
120122
result = ResponseUtil.failure(data=e.data, msg=e.message)
121123
except ServiceException as e:
124+
logger.error(e.message)
122125
result = ResponseUtil.error(data=e.data, msg=e.message)
123-
except ServiceWarning as e:
124-
result = ResponseUtil.failure(data=e.data, msg=e.message)
125126
except Exception as e:
127+
logger.exception(e)
126128
result = ResponseUtil.error(msg=str(e))
127129
# 获取请求耗时
128130
cost_time = float(time.time() - start_time) * 100
@@ -295,13 +297,14 @@ async def wrapper(*args, **kwargs):
295297
try:
296298
# 调用原始函数
297299
result = await func(*args, **kwargs)
298-
except LoginException as e:
300+
except (LoginException, ServiceWarning) as e:
301+
logger.warning(e.message)
299302
result = ResponseUtil.failure(data=e.data, msg=e.message)
300303
except ServiceException as e:
304+
logger.error(e.message)
301305
result = ResponseUtil.error(data=e.data, msg=e.message)
302-
except ServiceWarning as e:
303-
result = ResponseUtil.failure(data=e.data, msg=e.message)
304306
except Exception as e:
307+
logger.exception(e)
305308
result = ResponseUtil.error(msg=str(e))
306309
# 获取请求耗时
307310
cost_time = float(time.time() - start_time) * 100

ruoyi-fastapi-backend/module_admin/entity/vo/online_vo.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ class OnlineModel(BaseModel):
1313
model_config = ConfigDict(alias_generator=to_camel)
1414

1515
token_id: Optional[str] = Field(default=None, description='会话编号')
16-
user_name: Optional[str] = Field(default=None, description='部门名称')
17-
dept_name: Optional[str] = Field(default=None, description='用户名称')
18-
ipaddr: Optional[str] = Field(default=None, description='登录IP地址')
19-
login_location: Optional[str] = Field(default=None, description='登录地址')
16+
user_name: Optional[str] = Field(default=None, description='登录名称')
17+
dept_name: Optional[str] = Field(default=None, description='所属部门')
18+
ipaddr: Optional[str] = Field(default=None, description='主机')
19+
login_location: Optional[str] = Field(default=None, description='登录地点')
2020
browser: Optional[str] = Field(default=None, description='浏览器类型')
2121
os: Optional[str] = Field(default=None, description='操作系统')
2222
login_time: Optional[datetime] = Field(default=None, description='登录时间')

ruoyi-fastapi-backend/module_admin/service/online_service.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ async def get_online_list_services(cls, request: Request, query_object: OnlineQu
2222
:param query_object: 查询参数对象
2323
:return: 在线用户列表信息
2424
"""
25-
access_token_keys = await request.app.state.redis.keys(f"{RedisInitKeyConfig.ACCESS_TOKEN.key}*")
25+
access_token_keys = await request.app.state.redis.keys(f'{RedisInitKeyConfig.ACCESS_TOKEN.key}*')
2626
if not access_token_keys:
2727
access_token_keys = []
2828
access_token_values_list = [await request.app.state.redis.get(key) for key in access_token_keys]
@@ -40,11 +40,11 @@ async def get_online_list_services(cls, request: Request, query_object: OnlineQu
4040
login_time=payload.get('login_info').get('loginTime'),
4141
)
4242
if query_object.user_name and not query_object.ipaddr:
43-
if query_object.user_name == payload.get('login_info').get('ipaddr'):
43+
if query_object.user_name == payload.get('user_name'):
4444
online_info_list = [online_dict]
4545
break
4646
elif not query_object.user_name and query_object.ipaddr:
47-
if query_object.ipaddr == payload.get('ipaddr'):
47+
if query_object.ipaddr == payload.get('login_info').get('ipaddr'):
4848
online_info_list = [online_dict]
4949
break
5050
elif query_object.user_name and query_object.ipaddr:
@@ -70,7 +70,7 @@ async def delete_online_services(cls, request: Request, page_object: DeleteOnlin
7070
if page_object.token_ids:
7171
token_id_list = page_object.token_ids.split(',')
7272
for token_id in token_id_list:
73-
await request.app.state.redis.delete(f"{RedisInitKeyConfig.ACCESS_TOKEN.key}:{token_id}")
73+
await request.app.state.redis.delete(f'{RedisInitKeyConfig.ACCESS_TOKEN.key}:{token_id}')
7474
return CrudResponseModel(is_success=True, message='强退成功')
7575
else:
7676
raise ServiceException(message='传入session_id为空')

ruoyi-fastapi-backend/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ pandas==2.2.2
88
passlib[bcrypt]==1.7.4
99
Pillow==10.4.0
1010
psutil==6.0.0
11-
pydantic-validation-decorator==0.1.2
11+
pydantic-validation-decorator==0.1.4
1212
PyJWT[crypto]==2.8.0
1313
PyMySQL==1.1.1
1414
redis==5.0.7

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.2",
3+
"version": "1.3.3",
44
"description": "vfadmin管理系统",
55
"author": "insistence",
66
"license": "MIT",

0 commit comments

Comments
 (0)