Skip to content

Commit a5e7614

Browse files
insistencegitee-org
authored andcommitted
!5 RuoYi-Vue-FastAPI v1.0.3
Merge pull request !5 from insistence/develop
2 parents f1446e6 + 6000f2a commit a5e7614

File tree

6 files changed

+32
-13
lines changed

6 files changed

+32
-13
lines changed

README.md

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

1515

1616

17+
1718
## 平台简介
1819

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

ruoyi-fastapi-backend/.env.dev

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
# 应用运行环境
33
APP_ENV = 'dev'
44
# 应用名称
5-
APP_NAME = 'RuoYi-FasAPI'
5+
APP_NAME = 'RuoYi-FastAPI'
66
# 应用代理路径
77
APP_ROOT_PATH = '/dev-api'
88
# 应用主机
99
APP_HOST = '0.0.0.0'
1010
# 应用端口
1111
APP_PORT = 9099
1212
# 应用版本
13-
APP_VERSION= '1.0.2'
13+
APP_VERSION= '1.0.3'
1414
# 应用是否开启热重载
1515
APP_RELOAD = true
1616

ruoyi-fastapi-backend/.env.prod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
# 应用运行环境
33
APP_ENV = 'prod'
44
# 应用名称
5-
APP_NAME = 'RuoYi-FasAPI'
5+
APP_NAME = 'RuoYi-FastAPI'
66
# 应用代理路径
77
APP_ROOT_PATH = '/prod-api'
88
# 应用主机
99
APP_HOST = '0.0.0.0'
1010
# 应用端口
1111
APP_PORT = 9099
1212
# 应用版本
13-
APP_VERSION= '1.0.2'
13+
APP_VERSION= '1.0.3'
1414
# 应用是否开启热重载
1515
APP_RELOAD = false
1616

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

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ async def authenticate_user(cls, request: Request, query_db: Session, login_user
5656
:param login_user: 登录用户对象
5757
:return: 校验结果
5858
"""
59+
await cls.__check_login_ip(request)
5960
account_lock = await request.app.state.redis.get(
6061
f"{RedisInitKeyConfig.ACCOUNT_LOCK.get('key')}:{login_user.user_name}")
6162
if login_user.user_name == account_lock:
@@ -100,6 +101,21 @@ async def authenticate_user(cls, request: Request, query_db: Session, login_user
100101
f"{RedisInitKeyConfig.PASSWORD_ERROR_COUNT.get('key')}:{login_user.user_name}")
101102
return user
102103

104+
@classmethod
105+
async def __check_login_ip(cls, request: Request):
106+
"""
107+
校验用户登录ip是否在黑名单内
108+
:param request: Request对象
109+
:return: 校验结果
110+
"""
111+
black_ip_value = await request.app.state.redis.get(
112+
f"{RedisInitKeyConfig.SYS_CONFIG.get('key')}:sys.login.blackIPList")
113+
black_ip_list = black_ip_value.split(',') if black_ip_value else []
114+
if request.headers.get('X-Forwarded-For') in black_ip_list:
115+
logger.warning("当前IP禁止登录")
116+
raise LoginException(data="", message="当前IP禁止登录")
117+
return True
118+
103119
@classmethod
104120
async def __check_login_captcha(cls, request: Request, login_user: UserLogin):
105121
"""
@@ -229,14 +245,16 @@ def __generate_user_router_menu(cls, pid: int, permission_list):
229245
if permission.menu_type == 'M':
230246
router_list_data['name'] = permission.path.capitalize()
231247
router_list_data['hidden'] = False if permission.visible == '0' else True
232-
if permission.is_frame == 1:
233-
router_list_data['redirect'] = 'noRedirect'
234248
if permission.parent_id == 0:
235249
router_list_data['component'] = 'Layout'
236250
router_list_data['path'] = f'/{permission.path}'
237251
else:
238252
router_list_data['component'] = 'ParentView'
239253
router_list_data['path'] = permission.path
254+
if permission.is_frame == 1:
255+
router_list_data['redirect'] = 'noRedirect'
256+
else:
257+
router_list_data['path'] = permission.path
240258
if children:
241259
router_list_data['alwaysShow'] = True
242260
router_list_data['children'] = children

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

ruoyi-fastapi-frontend/src/views/system/menu/index.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@
166166
是否外链
167167
</span>
168168
<el-radio-group v-model="form.isFrame">
169-
<el-radio label="0">是</el-radio>
170-
<el-radio label="1">否</el-radio>
169+
<el-radio :label="0">是</el-radio>
170+
<el-radio :label="1">否</el-radio>
171171
</el-radio-group>
172172
</el-form-item>
173173
</el-col>
@@ -224,8 +224,8 @@
224224
是否缓存
225225
</span>
226226
<el-radio-group v-model="form.isCache">
227-
<el-radio label="0">缓存</el-radio>
228-
<el-radio label="1">不缓存</el-radio>
227+
<el-radio :label="0">缓存</el-radio>
228+
<el-radio :label="1">不缓存</el-radio>
229229
</el-radio-group>
230230
</el-form-item>
231231
</el-col>

0 commit comments

Comments
 (0)