Skip to content

Commit 2c77028

Browse files
insistencegitee-org
authored andcommitted
!25 RuoYi-Vue-FastAPI v1.7.1
Merge pull request !25 from insistence/develop
2 parents 0d03a03 + ca5b2d9 commit 2c77028

File tree

10 files changed

+26
-15
lines changed

10 files changed

+26
-15
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-Vue-FastAPI v1.7.0</h1>
4+
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">RuoYi-Vue-FastAPI v1.7.1</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.7.0-brightgreen.svg"></a>
9+
<a href="https://gitee.com/insistence2022/RuoYi-Vue-FastAPI"><img src="https://img.shields.io/badge/RuoYiVueFastAPI-v1.7.1-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/node-≥14-blue">
1212
<img src="https://img.shields.io/badge/python-≥3.9-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.7.0'
13+
APP_VERSION= '1.7.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.7.0'
13+
APP_VERSION= '1.7.1'
1414
# 应用是否开启热重载
1515
APP_RELOAD = false
1616
# 应用是否开启IP归属区域查询

ruoyi-fastapi-backend/module_generator/templates/python/controller.py.jinja2

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
{% set pkField = pkColumn.python_field %}
22
{% set pk_field = pkColumn.python_field | camel_to_snake %}
3+
{% set need_import_datetime = namespace(has_datetime=False) %}
34
{% for column in columns %}
4-
{% if column.python_field == "createTime" %}
5-
from datetime import datetime
5+
{% if column.python_field in ["createTime", "updatetime"] %}
6+
{% set need_import_datetime.has_datetime = True %}
67
{% endif %}
78
{% endfor %}
9+
{% if need_import_datetime.has_datetime %}
10+
from datetime import datetime
11+
{% endif %}
812
from fastapi import APIRouter, Depends, Form, Request
913
from pydantic_validation_decorator import ValidateFields
1014
from sqlalchemy.ext.asyncio import AsyncSession
@@ -82,8 +86,13 @@ async def edit_{{ moduleName }}_{{ businessName }}(
8286
query_db: AsyncSession = Depends(get_db),
8387
current_user: CurrentUserModel = Depends(LoginService.get_current_user),
8488
):
89+
{% for column in columns %}
90+
{% if column.python_field == "updateBy" %}
8591
edit_{{ businessName }}.update_by = current_user.user.user_name
92+
{% elif column.python_field == "updateTime" %}
8693
edit_{{ businessName }}.update_time = datetime.now()
94+
{% endif %}
95+
{% endfor %}
8796
edit_{{ businessName }}_result = await {{ BusinessName }}Service.edit_{{ businessName }}_services(query_db, edit_{{ businessName }})
8897
logger.info(edit_{{ businessName }}_result.message)
8998

ruoyi-fastapi-backend/module_generator/templates/python/do.py.jinja2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class {{ ClassName }}(Base):
1313
"""
1414

1515
__tablename__ = '{{ tableName }}'
16+
__table_args__ = {'comment': '{{ tableComment }}'}
1617

1718
{% for column in columns %}
1819
{{ column.column_name }} = Column({{ column.column_type | get_sqlalchemy_type }}, {% if column.pk %}primary_key=True, {% endif %}{% if column.increment %}autoincrement=True, {% endif %}{% if column.required or column.pk %}nullable=False{% else %}nullable=True{% endif %}, comment='{{ column.column_comment }}')

ruoyi-fastapi-backend/requirements-pg.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ alembic==1.16.4
22
APScheduler==3.11.0
33
async-lru==2.0.5
44
asyncpg==0.30.0
5+
bcrypt==5.0.0
56
DateTime==5.5
67
fastapi[all]==0.116.1
78
loguru==0.7.3
89
openpyxl==3.1.5
910
pandas==2.3.2
10-
passlib[bcrypt]==1.7.4
1111
Pillow==11.3.0
1212
psutil==7.0.0
1313
pydantic-validation-decorator==0.1.4

ruoyi-fastapi-backend/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ alembic==1.16.4
22
APScheduler==3.11.0
33
async-lru==2.0.5
44
asyncmy==0.2.10
5+
bcrypt==5.0.0
56
DateTime==5.5
67
fastapi[all]==0.116.1
78
loguru==0.7.3
89
openpyxl==3.1.5
910
pandas==2.3.2
10-
passlib[bcrypt]==1.7.4
1111
Pillow==11.3.0
1212
psutil==7.0.0
1313
pydantic-validation-decorator==0.1.4
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
from passlib.context import CryptContext
2-
3-
pwd_context = CryptContext(schemes=['bcrypt'], deprecated='auto')
1+
import bcrypt
42

53

64
class PwdUtil:
@@ -9,15 +7,17 @@ class PwdUtil:
97
"""
108

119
@classmethod
12-
def verify_password(cls, plain_password, hashed_password):
10+
def verify_password(cls, plain_password: str, hashed_password: str) -> bool:
1311
"""
1412
工具方法:校验当前输入的密码与数据库存储的密码是否一致
1513
1614
:param plain_password: 当前输入的密码
1715
:param hashed_password: 数据库存储的密码
1816
:return: 校验结果
1917
"""
20-
return pwd_context.verify(plain_password, hashed_password)
18+
return (
19+
bcrypt.checkpw(plain_password.encode('utf-8'), hashed_password.encode('utf-8')) if hashed_password else None
20+
)
2121

2222
@classmethod
2323
def get_password_hash(cls, input_password):
@@ -27,4 +27,4 @@ def get_password_hash(cls, input_password):
2727
:param input_password: 输入的密码
2828
:return: 加密成功的密码
2929
"""
30-
return pwd_context.hash(input_password)
30+
return bcrypt.hashpw(input_password.encode('utf-8'), bcrypt.gensalt()).decode('utf-8')

ruoyi-fastapi-backend/utils/template_util.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ def prepare_context(cls, gen_table: GenTableModel):
7373
context = {
7474
'tplCategory': tpl_category,
7575
'tableName': gen_table.table_name,
76+
'tableComment': gen_table.table_comment,
7677
'functionName': function_name if StringUtil.is_not_empty(function_name) else '【请填写功能名称】',
7778
'ClassName': class_name,
7879
'className': class_name.lower(),

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

0 commit comments

Comments
 (0)