!17 RuoYi-Vue3-FastAPI v1.3.3
Merge pull request !17 from insistence/develop
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
<p align="center">
|
||||
<img alt="logo" src="https://oscimg.oschina.net/oscnet/up-d3d0a9303e11d522a06cd263f3079027715.png">
|
||||
</p>
|
||||
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">RuoYi-Vue3-FastAPI v1.3.2</h1>
|
||||
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">RuoYi-Vue3-FastAPI v1.3.3</h1>
|
||||
<h4 align="center">基于RuoYi-Vue3+FastAPI前后端分离的快速开发框架</h4>
|
||||
<p align="center">
|
||||
<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>
|
||||
<a href="https://github.com/insistence/RuoYi-Vue3-FastAPI"><img src="https://img.shields.io/github/stars/insistence/RuoYi-Vue3-FastAPI?style=social"></a>
|
||||
<a href="https://gitee.com/insistence2022/RuoYi-Vue3-FastAPI"><img src="https://img.shields.io/badge/RuoYiVue3FastAPI-v1.3.2-brightgreen.svg"></a>
|
||||
<a href="https://gitee.com/insistence2022/RuoYi-Vue3-FastAPI"><img src="https://img.shields.io/badge/RuoYiVue3FastAPI-v1.3.3-brightgreen.svg"></a>
|
||||
<a href="https://gitee.com/insistence2022/RuoYi-Vue3-FastAPI/blob/master/LICENSE"><img src="https://img.shields.io/github/license/mashape/apistatus.svg"></a>
|
||||
<img src="https://img.shields.io/badge/python-≥3.9-blue">
|
||||
<img src="https://img.shields.io/badge/MySQL-≥5.7-blue">
|
||||
|
@@ -10,7 +10,7 @@ APP_HOST = '0.0.0.0'
|
||||
# 应用端口
|
||||
APP_PORT = 9099
|
||||
# 应用版本
|
||||
APP_VERSION= '1.3.2'
|
||||
APP_VERSION= '1.3.3'
|
||||
# 应用是否开启热重载
|
||||
APP_RELOAD = true
|
||||
# 应用是否开启IP归属区域查询
|
||||
|
@@ -10,7 +10,7 @@ APP_HOST = '0.0.0.0'
|
||||
# 应用端口
|
||||
APP_PORT = 9099
|
||||
# 应用版本
|
||||
APP_VERSION= '1.3.2'
|
||||
APP_VERSION= '1.3.3'
|
||||
# 应用是否开启热重载
|
||||
APP_RELOAD = false
|
||||
# 应用是否开启IP归属区域查询
|
||||
|
@@ -16,6 +16,7 @@ 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.log_util import logger
|
||||
from utils.response_util import ResponseUtil
|
||||
|
||||
|
||||
@@ -116,13 +117,14 @@ class Log:
|
||||
try:
|
||||
# 调用原始函数
|
||||
result = await func(*args, **kwargs)
|
||||
except LoginException as e:
|
||||
except (LoginException, ServiceWarning) as e:
|
||||
logger.warning(e.message)
|
||||
result = ResponseUtil.failure(data=e.data, msg=e.message)
|
||||
except ServiceException as e:
|
||||
logger.error(e.message)
|
||||
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:
|
||||
logger.exception(e)
|
||||
result = ResponseUtil.error(msg=str(e))
|
||||
# 获取请求耗时
|
||||
cost_time = float(time.time() - start_time) * 100
|
||||
@@ -295,13 +297,14 @@ def log_decorator(
|
||||
try:
|
||||
# 调用原始函数
|
||||
result = await func(*args, **kwargs)
|
||||
except LoginException as e:
|
||||
except (LoginException, ServiceWarning) as e:
|
||||
logger.warning(e.message)
|
||||
result = ResponseUtil.failure(data=e.data, msg=e.message)
|
||||
except ServiceException as e:
|
||||
logger.error(e.message)
|
||||
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:
|
||||
logger.exception(e)
|
||||
result = ResponseUtil.error(msg=str(e))
|
||||
# 获取请求耗时
|
||||
cost_time = float(time.time() - start_time) * 100
|
||||
|
@@ -13,10 +13,10 @@ class OnlineModel(BaseModel):
|
||||
model_config = ConfigDict(alias_generator=to_camel)
|
||||
|
||||
token_id: Optional[str] = Field(default=None, description='会话编号')
|
||||
user_name: Optional[str] = Field(default=None, description='部门名称')
|
||||
dept_name: Optional[str] = Field(default=None, description='用户名称')
|
||||
ipaddr: Optional[str] = Field(default=None, description='登录IP地址')
|
||||
login_location: Optional[str] = Field(default=None, description='登录地址')
|
||||
user_name: Optional[str] = Field(default=None, description='登录名称')
|
||||
dept_name: Optional[str] = Field(default=None, description='所属部门')
|
||||
ipaddr: Optional[str] = Field(default=None, description='主机')
|
||||
login_location: Optional[str] = Field(default=None, description='登录地点')
|
||||
browser: Optional[str] = Field(default=None, description='浏览器类型')
|
||||
os: Optional[str] = Field(default=None, description='操作系统')
|
||||
login_time: Optional[datetime] = Field(default=None, description='登录时间')
|
||||
|
@@ -22,7 +22,7 @@ class OnlineService:
|
||||
:param query_object: 查询参数对象
|
||||
:return: 在线用户列表信息
|
||||
"""
|
||||
access_token_keys = await request.app.state.redis.keys(f"{RedisInitKeyConfig.ACCESS_TOKEN.key}*")
|
||||
access_token_keys = await request.app.state.redis.keys(f'{RedisInitKeyConfig.ACCESS_TOKEN.key}*')
|
||||
if not access_token_keys:
|
||||
access_token_keys = []
|
||||
access_token_values_list = [await request.app.state.redis.get(key) for key in access_token_keys]
|
||||
@@ -40,11 +40,11 @@ class OnlineService:
|
||||
login_time=payload.get('login_info').get('loginTime'),
|
||||
)
|
||||
if query_object.user_name and not query_object.ipaddr:
|
||||
if query_object.user_name == payload.get('login_info').get('ipaddr'):
|
||||
if query_object.user_name == payload.get('user_name'):
|
||||
online_info_list = [online_dict]
|
||||
break
|
||||
elif not query_object.user_name and query_object.ipaddr:
|
||||
if query_object.ipaddr == payload.get('ipaddr'):
|
||||
if query_object.ipaddr == payload.get('login_info').get('ipaddr'):
|
||||
online_info_list = [online_dict]
|
||||
break
|
||||
elif query_object.user_name and query_object.ipaddr:
|
||||
@@ -70,7 +70,7 @@ class OnlineService:
|
||||
if page_object.token_ids:
|
||||
token_id_list = page_object.token_ids.split(',')
|
||||
for token_id in token_id_list:
|
||||
await request.app.state.redis.delete(f"{RedisInitKeyConfig.ACCESS_TOKEN.key}:{token_id}")
|
||||
await request.app.state.redis.delete(f'{RedisInitKeyConfig.ACCESS_TOKEN.key}:{token_id}')
|
||||
return CrudResponseModel(is_success=True, message='强退成功')
|
||||
else:
|
||||
raise ServiceException(message='传入session_id为空')
|
||||
|
@@ -8,7 +8,7 @@ pandas==2.2.2
|
||||
passlib[bcrypt]==1.7.4
|
||||
Pillow==10.4.0
|
||||
psutil==6.0.0
|
||||
pydantic-validation-decorator==0.1.2
|
||||
pydantic-validation-decorator==0.1.4
|
||||
PyJWT[crypto]==2.8.0
|
||||
PyMySQL==1.1.1
|
||||
redis==5.0.7
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "vfadmin",
|
||||
"version": "1.3.2",
|
||||
"version": "1.3.3",
|
||||
"description": "vfadmin管理系统",
|
||||
"author": "insistence",
|
||||
"license": "MIT",
|
||||
|
Reference in New Issue
Block a user