Browse Source
!16 RuoYi-Vue3-FastAPI v1.3.2
Merge pull request !16 from insistence/develop
master
insistence
10 months ago
committed by
Gitee
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
10 changed files with
65 additions and
42 deletions
-
.gitignore
-
README.md
-
ruoyi-fastapi-backend/.env.dev
-
ruoyi-fastapi-backend/.env.prod
-
ruoyi-fastapi-backend/config/get_scheduler.py
-
ruoyi-fastapi-backend/middlewares/cors_middleware.py
-
ruoyi-fastapi-backend/middlewares/gzip_middleware.py
-
ruoyi-fastapi-backend/middlewares/handle.py
-
ruoyi-fastapi-backend/utils/page_util.py
-
ruoyi-fastapi-frontend/package.json
|
@ -18,6 +18,7 @@ lib64/ |
|
|
parts/ |
|
|
parts/ |
|
|
sdist/ |
|
|
sdist/ |
|
|
var/ |
|
|
var/ |
|
|
|
|
|
vf_admin/ |
|
|
wheels/ |
|
|
wheels/ |
|
|
share/python-wheels/ |
|
|
share/python-wheels/ |
|
|
*.egg-info/ |
|
|
*.egg-info/ |
|
|
|
@ -1,12 +1,12 @@ |
|
|
<p align="center"> |
|
|
<p align="center"> |
|
|
<img alt="logo" src="https://oscimg.oschina.net/oscnet/up-d3d0a9303e11d522a06cd263f3079027715.png"> |
|
|
<img alt="logo" src="https://oscimg.oschina.net/oscnet/up-d3d0a9303e11d522a06cd263f3079027715.png"> |
|
|
</p> |
|
|
</p> |
|
|
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">RuoYi-Vue3-FastAPI v1.3.1</h1> |
|
|
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">RuoYi-Vue3-FastAPI v1.3.2</h1> |
|
|
<h4 align="center">基于RuoYi-Vue3+FastAPI前后端分离的快速开发框架</h4> |
|
|
<h4 align="center">基于RuoYi-Vue3+FastAPI前后端分离的快速开发框架</h4> |
|
|
<p align="center"> |
|
|
<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://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://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.1-brightgreen.svg"></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/blob/master/LICENSE"><img src="https://img.shields.io/github/license/mashape/apistatus.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/python-≥3.9-blue"> |
|
|
<img src="https://img.shields.io/badge/MySQL-≥5.7-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_PORT = 9099 |
|
|
# 应用版本 |
|
|
# 应用版本 |
|
|
APP_VERSION= '1.3.1' |
|
|
APP_VERSION= '1.3.2' |
|
|
# 应用是否开启热重载 |
|
|
# 应用是否开启热重载 |
|
|
APP_RELOAD = true |
|
|
APP_RELOAD = true |
|
|
# 应用是否开启IP归属区域查询 |
|
|
# 应用是否开启IP归属区域查询 |
|
|
|
@ -10,7 +10,7 @@ APP_HOST = '0.0.0.0' |
|
|
# 应用端口 |
|
|
# 应用端口 |
|
|
APP_PORT = 9099 |
|
|
APP_PORT = 9099 |
|
|
# 应用版本 |
|
|
# 应用版本 |
|
|
APP_VERSION= '1.3.1' |
|
|
APP_VERSION= '1.3.2' |
|
|
# 应用是否开启热重载 |
|
|
# 应用是否开启热重载 |
|
|
APP_RELOAD = false |
|
|
APP_RELOAD = false |
|
|
# 应用是否开启IP归属区域查询 |
|
|
# 应用是否开启IP归属区域查询 |
|
|
|
@ -221,6 +221,7 @@ class SchedulerUtil: |
|
|
if event_type == 'JobExecutionEvent' and event.exception: |
|
|
if event_type == 'JobExecutionEvent' and event.exception: |
|
|
exception_info = str(event.exception) |
|
|
exception_info = str(event.exception) |
|
|
status = '1' |
|
|
status = '1' |
|
|
|
|
|
if hasattr(event, 'job_id'): |
|
|
job_id = event.job_id |
|
|
job_id = event.job_id |
|
|
query_job = cls.get_scheduler_job(job_id=job_id) |
|
|
query_job = cls.get_scheduler_job(job_id=job_id) |
|
|
if query_job: |
|
|
if query_job: |
|
|
|
@ -3,6 +3,12 @@ from fastapi.middleware.cors import CORSMiddleware |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def add_cors_middleware(app: FastAPI): |
|
|
def add_cors_middleware(app: FastAPI): |
|
|
|
|
|
""" |
|
|
|
|
|
添加跨域中间件 |
|
|
|
|
|
|
|
|
|
|
|
:param app: FastAPI对象 |
|
|
|
|
|
:return: |
|
|
|
|
|
""" |
|
|
# 前端页面url |
|
|
# 前端页面url |
|
|
origins = [ |
|
|
origins = [ |
|
|
'http://localhost:80', |
|
|
'http://localhost:80', |
|
|
|
@ -0,0 +1,12 @@ |
|
|
|
|
|
from fastapi import FastAPI |
|
|
|
|
|
from starlette.middleware.gzip import GZipMiddleware |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def add_gzip_middleware(app: FastAPI): |
|
|
|
|
|
""" |
|
|
|
|
|
添加gzip压缩中间件 |
|
|
|
|
|
|
|
|
|
|
|
:param app: FastAPI对象 |
|
|
|
|
|
:return: |
|
|
|
|
|
""" |
|
|
|
|
|
app.add_middleware(GZipMiddleware, minimum_size=1000, compresslevel=9) |
|
@ -1,5 +1,6 @@ |
|
|
from fastapi import FastAPI |
|
|
from fastapi import FastAPI |
|
|
from middlewares.cors_middleware import add_cors_middleware |
|
|
from middlewares.cors_middleware import add_cors_middleware |
|
|
|
|
|
from middlewares.gzip_middleware import add_gzip_middleware |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def handle_middleware(app: FastAPI): |
|
|
def handle_middleware(app: FastAPI): |
|
@ -8,3 +9,5 @@ def handle_middleware(app: FastAPI): |
|
|
""" |
|
|
""" |
|
|
# 加载跨域中间件 |
|
|
# 加载跨域中间件 |
|
|
add_cors_middleware(app) |
|
|
add_cors_middleware(app) |
|
|
|
|
|
# 加载gzip压缩中间件 |
|
|
|
|
|
add_gzip_middleware(app) |
|
|
|
@ -71,7 +71,7 @@ class PageUtil: |
|
|
paginated_data.append(row[0]) |
|
|
paginated_data.append(row[0]) |
|
|
else: |
|
|
else: |
|
|
paginated_data.append(row) |
|
|
paginated_data.append(row) |
|
|
has_next = True if math.ceil(len(paginated_data) / page_size) > page_num else False |
|
|
has_next = math.ceil(total / page_size) > page_num |
|
|
result = PageResponseModel( |
|
|
result = PageResponseModel( |
|
|
rows=CamelCaseUtil.transform_result(paginated_data), |
|
|
rows=CamelCaseUtil.transform_result(paginated_data), |
|
|
pageNum=page_num, |
|
|
pageNum=page_num, |
|
|
|
@ -1,6 +1,6 @@ |
|
|
{ |
|
|
{ |
|
|
"name": "vfadmin", |
|
|
"name": "vfadmin", |
|
|
"version": "1.3.1", |
|
|
"version": "1.3.2", |
|
|
"description": "vfadmin管理系统", |
|
|
"description": "vfadmin管理系统", |
|
|
"author": "insistence", |
|
|
"author": "insistence", |
|
|
"license": "MIT", |
|
|
"license": "MIT", |
|
|