From db118f04ff6b7c3154ac46f978daf5cd0b88df63 Mon Sep 17 00:00:00 2001 From: Teishorin Date: Fri, 8 Sep 2023 11:22:18 +0000 Subject: [PATCH 1/8] =?UTF-8?q?update=20templates/system/power/add.html.?= =?UTF-8?q?=20=E6=8A=8A=E6=8E=92=E5=BA=8F=E5=88=97=E4=B8=BA=E5=BF=85?= =?UTF-8?q?=E5=A1=AB=E9=A1=B9=EF=BC=8C=E9=98=B2=E6=AD=A2=E5=9B=A0=E4=B8=BA?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E5=A1=AB=E5=86=99=E5=BA=8F=E5=8F=B7=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E5=B7=A6=E4=BE=A7=E8=BE=B9=E6=A0=8F=E6=B6=88=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Teishorin --- templates/system/power/add.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/system/power/add.html b/templates/system/power/add.html index be4c1d8..9460fb3 100644 --- a/templates/system/power/add.html +++ b/templates/system/power/add.html @@ -63,7 +63,7 @@
-
From e4e04f5c1a36f1554c11931239a72b980239fbe2 Mon Sep 17 00:00:00 2001 From: Teishorin Date: Fri, 8 Sep 2023 11:26:45 +0000 Subject: [PATCH 2/8] =?UTF-8?q?update=20templates/system/power/edit.html.?= =?UTF-8?q?=20=E5=B0=86=E6=8E=92=E5=BA=8F=E6=94=B9=E4=B8=BA=E5=BF=85?= =?UTF-8?q?=E5=A1=AB=E9=A1=B9=EF=BC=8C=E9=98=B2=E6=AD=A2=E5=9B=A0=E4=B8=BA?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E5=A1=AB=E5=86=99=E6=8E=92=E5=BA=8F=E5=8F=B7?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E5=B7=A6=E4=BE=A7=E5=AF=BC=E8=88=AA=E6=9D=A1?= =?UTF-8?q?=E6=B6=88=E5=A4=B1=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Teishorin --- templates/system/power/edit.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/system/power/edit.html b/templates/system/power/edit.html index ad5db4c..aa7c695 100644 --- a/templates/system/power/edit.html +++ b/templates/system/power/edit.html @@ -75,7 +75,7 @@
-
From 09c210363ef716e44134a1b463b4c916c5d11957 Mon Sep 17 00:00:00 2001 From: Huo-WenBo <1684240320@qq.com> Date: Thu, 21 Sep 2023 06:43:20 +0000 Subject: [PATCH 3/8] =?UTF-8?q?update=20requirements.txt.=20=E9=87=8D?= =?UTF-8?q?=E6=96=B0=E7=94=9F=E6=88=90=E9=A1=B9=E7=9B=AE=20requirements.tx?= =?UTF-8?q?t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Huo-WenBo <1684240320@qq.com> --- requirements.txt | 56 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 42 insertions(+), 14 deletions(-) diff --git a/requirements.txt b/requirements.txt index 44355bb..4aec34f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,14 +1,42 @@ -Flask -Flask-APScheduler -Flask-Migrate -Flask-Login -Flask_Reuploaded -Flask-SQLAlchemy -flask-marshmallow -marshmallow-sqlalchemy -PyMySQL -psutil -Flask-Mail -Pillow -cryptography -validators \ No newline at end of file +alembic==1.11.1 +annotated-types==0.5.0 +APScheduler==3.10.1 +blinker==1.6.2 +cffi==1.15.1 +click==8.1.6 +colorama==0.4.6 +cryptography==41.0.2 +decorator==5.1.1 +Flask==2.3.2 +Flask-APScheduler==1.12.4 +Flask-Login==0.6.2 +Flask-Mail==0.9.1 +flask-marshmallow==0.15.0 +Flask-Migrate==4.0.4 +Flask-Reuploaded==1.3.0 +Flask-SQLAlchemy==3.0.5 +greenlet==2.0.2 +importlib-metadata==6.8.0 +itsdangerous==2.1.2 +Jinja2==3.1.2 +Mako==1.2.4 +MarkupSafe==2.1.3 +marshmallow==3.20.1 +marshmallow-sqlalchemy==0.29.0 +packaging==23.1 +Pillow==10.0.0 +psutil==5.9.5 +pycparser==2.21 +pydantic==2.1.1 +pydantic_core==2.4.0 +PyMySQL==1.1.0 +python-dateutil==2.8.2 +pytz==2023.3 +six==1.16.0 +SQLAlchemy==2.0.19 +typing_extensions==4.7.1 +tzdata==2023.3 +tzlocal==5.0.1 +validators==0.20.0 +Werkzeug==2.3.6 +zipp==3.16.2 From 9abb4ae6a98b041cec6eec9697f8efab98802b1c Mon Sep 17 00:00:00 2001 From: Huo-WenBo <1684240320@qq.com> Date: Thu, 21 Sep 2023 06:44:33 +0000 Subject: [PATCH 4/8] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20from=20flask=5Fsqlalch?= =?UTF-8?q?emyimport=20BaseQuery=20=E4=B8=8D=E8=83=BD=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Huo-WenBo <1684240320@qq.com> --- applications/extensions/init_sqlalchemy.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/applications/extensions/init_sqlalchemy.py b/applications/extensions/init_sqlalchemy.py index c0aff14..d128c22 100644 --- a/applications/extensions/init_sqlalchemy.py +++ b/applications/extensions/init_sqlalchemy.py @@ -2,7 +2,8 @@ import datetime import os from flask import Flask, request -from flask_sqlalchemy import SQLAlchemy, BaseQuery +from flask_sqlalchemy import SQLAlchemy +from flask_sqlalchemy.query import Query as BaseQuery from flask_marshmallow import Marshmallow from marshmallow import fields from marshmallow.validate import ( From dbb03e3e44ba662b9a94eeb8624cd54fb22fbddc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=BF=83=E5=B7=A7?= <12432082+chenxinqiao@user.noreply.gitee.com> Date: Fri, 22 Sep 2023 04:15:08 +0000 Subject: [PATCH 5/8] =?UTF-8?q?update=20docs/install.md.=20requirement.txt?= =?UTF-8?q?=20=E6=94=B9=E6=88=90=E4=BA=86requirements.txt=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bat 是 win下的, 这里原来写反了。 另外 在执行 flask db init 会报错导入不了BaseQuery,因为 Flask-SQLAlchemy 在3.0后,BaseQuery改成了Query。 Signed-off-by: 陈心巧 <12432082+chenxinqiao@user.noreply.gitee.com> --- docs/install.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/install.md b/docs/install.md index a617ac5..c4b2002 100644 --- a/docs/install.md +++ b/docs/install.md @@ -44,7 +44,7 @@ source ./test_env/bin/activate ```shell # 使用 pip 安装必要模块(对于 master 分支) -pip install -r requirement\requirement.txt +pip install -r requirements.txt # 使用 pip 安装必要模块(对于 mini 分支) pip install -r requirement.txt @@ -76,10 +76,10 @@ flask admin init #### 运行项目 ```shell -# linux +# windows run.bat -# windows +# linux ./run.sh ``` From f02362859d1e66a6e928c37f8b03625c7c1c2788 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=BF=83=E5=B7=A7?= <12432082+chenxinqiao@user.noreply.gitee.com> Date: Thu, 9 Nov 2023 08:05:03 +0000 Subject: [PATCH 6/8] =?UTF-8?q?update=20templates/system/dept/main.html.?= =?UTF-8?q?=20=E7=82=B9=E5=87=BB=E7=BC=96=E8=BE=91=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E5=90=8E=EF=BC=8Cobj.data['deptId']=20=E5=9B=A0=E5=85=B6?= =?UTF-8?q?=E6=9C=AA=E5=AE=9A=E4=B9=89=E4=BC=9A=E6=8A=9B=E5=87=BA=E9=94=99?= =?UTF-8?q?=E8=AF=AF=EF=BC=8C=E5=AF=BC=E8=87=B4ajax=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E8=AF=A5=E9=A1=B9=E5=86=85=E5=AE=B9=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=EF=BC=8C=E5=AF=BC=E8=87=B4=E8=AF=A5=E9=A1=B9=E5=BE=85?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=86=85=E5=AE=B9=E4=B8=8D=E8=83=BD=E8=AF=BB?= =?UTF-8?q?=E5=8F=96=E3=80=82=E6=94=B9=E6=88=90=20obj.data['id']=20?= =?UTF-8?q?=E5=8D=B3=E5=8F=AF=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 陈心巧 <12432082+chenxinqiao@user.noreply.gitee.com> --- templates/system/dept/main.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/system/dept/main.html b/templates/system/dept/main.html index 5f4fec7..2e66065 100644 --- a/templates/system/dept/main.html +++ b/templates/system/dept/main.html @@ -199,7 +199,8 @@ title: '修改', shade: 0.1, area: ['450px', '500px'], - content: MODULE_PATH + 'edit?deptId=' + obj.data['deptId'] + //content: MODULE_PATH + 'edit?deptId=' + obj.data['deptId'] + content: MODULE_PATH + 'edit?deptId=' + obj.data['id'] }) } From 2e806f1dcfe4a25e434553f85ad4939eddf123e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=BF=83=E5=B7=A7?= <12432082+chenxinqiao@user.noreply.gitee.com> Date: Thu, 9 Nov 2023 08:11:17 +0000 Subject: [PATCH 7/8] =?UTF-8?q?update=20applications/view/system/dept.py.?= =?UTF-8?q?=20=E4=BF=AE=E6=AD=A3=E9=83=A8=E9=97=A8=E4=B8=8D=E8=83=BD?= =?UTF-8?q?=E6=9B=B4=E6=96=B0bug=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit id = json.get("deptId"), 会得到tuple 在其后的 Dept.query.filter_by(id=id) , 会生成形如 update 。。。。 from xx where id=( id, ) 的sql,导致执行sql失败 #id = json.get("deptId"), 改成 id = str_escape(json.get("deptId")) 即可。 Signed-off-by: 陈心巧 <12432082+chenxinqiao@user.noreply.gitee.com> --- applications/view/system/dept.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/applications/view/system/dept.py b/applications/view/system/dept.py index 91941d8..20e4a09 100644 --- a/applications/view/system/dept.py +++ b/applications/view/system/dept.py @@ -108,7 +108,8 @@ def dis_enable(): @authorize("system:dept:edit", log=True) def update(): json = request.get_json(force=True) - id = json.get("deptId"), + #id = json.get("deptId"), + id = str_escape(json.get("deptId")) data = { "dept_name": validate.str_escape(json.get("deptName")), "sort": validate.str_escape(json.get("sort")), From 2683e1214c51f49db3aa525e569c501156084c09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E8=83=9C=E8=88=9F?= <1650473152@com> Date: Tue, 14 Nov 2023 19:44:38 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E9=83=A8=E9=97=A8=E6=A0=91=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=EF=BC=8C=E5=9B=9E=E9=80=80sqlalchemy=E5=BC=95=E7=94=A8?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E5=A4=8D=E5=A4=B4=E5=83=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- applications/extensions/init_sqlalchemy.py | 3 +- templates/system/user/edit.html | 78 +++++++++++----------- templates/system/user/profile.html | 2 +- 3 files changed, 41 insertions(+), 42 deletions(-) diff --git a/applications/extensions/init_sqlalchemy.py b/applications/extensions/init_sqlalchemy.py index d128c22..c0aff14 100644 --- a/applications/extensions/init_sqlalchemy.py +++ b/applications/extensions/init_sqlalchemy.py @@ -2,8 +2,7 @@ import datetime import os from flask import Flask, request -from flask_sqlalchemy import SQLAlchemy -from flask_sqlalchemy.query import Query as BaseQuery +from flask_sqlalchemy import SQLAlchemy, BaseQuery from flask_marshmallow import Marshmallow from marshmallow import fields from marshmallow.validate import ( diff --git a/templates/system/user/edit.html b/templates/system/user/edit.html index 32f8542..8fbea3a 100644 --- a/templates/system/user/edit.html +++ b/templates/system/user/edit.html @@ -71,48 +71,48 @@ {% include 'system/common/footer.html' %} \ No newline at end of file diff --git a/templates/system/user/profile.html b/templates/system/user/profile.html index 62550bf..9480420 100644 --- a/templates/system/user/profile.html +++ b/templates/system/user/profile.html @@ -65,7 +65,7 @@ formData.append('fileToken', timeStamp) $.ajax({ method: 'post', - url: '/admin/file/upload', //用于文件上传的服务器端请求地址 + url: '/system/file/upload', //用于文件上传的服务器端请求地址 data: formData, processData: false, contentType: false,