diff --git a/README.md b/README.md index 79e85b7..4edbbe0 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@
-
-
+
diff --git a/applications/extensions/__init__.py b/applications/extensions/__init__.py
index b1f9913..8849131 100644
--- a/applications/extensions/__init__.py
+++ b/applications/extensions/__init__.py
@@ -18,9 +18,11 @@ def init_plugs(app: Flask) -> None:
# 注册 Flask 功能
init_login_manager(app)
init_databases(app)
- init_template_directives(app)
- init_error_views(app)
init_mail(app)
init_upload(app)
init_migrate(app)
init_session(app)
+
+ # 系统蓝图相关
+ init_template_directives(app)
+ init_error_views(app)
diff --git a/docs/source/_static/Pear Admin Flask 启动流程图.drawio b/docs/source/_static/Pear Admin Flask 启动流程图.drawio
new file mode 100644
index 0000000..ffb2f75
--- /dev/null
+++ b/docs/source/_static/Pear Admin Flask 启动流程图.drawio
@@ -0,0 +1,247 @@
+
+
diff --git a/docs/source/welcome/migration.rst b/docs/source/welcome/migration.rst
index 2481b9d..6e16ba8 100644
--- a/docs/source/welcome/migration.rst
+++ b/docs/source/welcome/migration.rst
@@ -110,4 +110,21 @@
.. code-block:: python
- from applications.common.admin import admin_log
\ No newline at end of file
+ from applications.common.admin import admin_log
+
+验证码生成路由修改
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+为了优化代码,将验证码生成路由改为了 system.passport.captcha 。这主要会影响前端模板渲染。
+
+例如:
+
+.. code-block:: html
+
+ url_for('system.passport.get_captcha')
+
+改为:
+
+.. code-block:: python
+
+ url_for('system.passport.captcha')
diff --git a/docs/source/welcome/update.rst b/docs/source/welcome/update.rst
index 039c1ee..84b5cbb 100644
--- a/docs/source/welcome/update.rst
+++ b/docs/source/welcome/update.rst
@@ -40,6 +40,8 @@
* 更正登录之后重定向由于路由更改从而设置错误的问题
* 将 applications/common/admin_log.py 与 applications/common/admin.py 合并,仅留下 applications/common/admin.py
* 优化代码结构,新增函数 `normal_log` 减少代码复用
+* 添加了新插件的事件
+* 修改了验证码生成路由
已知问题以及解决方式
~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/plugins/helloworld/__init__.py b/plugins/helloworld/__init__.py
index c6c6fc1..1e560e3 100644
--- a/plugins/helloworld/__init__.py
+++ b/plugins/helloworld/__init__.py
@@ -32,7 +32,8 @@ def event_finish(app: Flask): # 在项目所有功能注册之后调用(插
def event_context(app: Flask): # Flask 初始化完成,等待第一个请求之前,等同于 with app.app_context():
print("第一个请求来之前加载")
+ # 数据库已经初始化完成,尝试读取
dept = Dept.query.order_by(Dept.sort).all()
power_data = curd.model_to_dicts(schema=DeptSchema, data=dept)
- print(power_data)
+ # print(power_data)
diff --git a/templates/system/login.html b/templates/system/login.html
index 19d9d45..4018f11 100644
--- a/templates/system/login.html
+++ b/templates/system/login.html
@@ -96,7 +96,7 @@
var popup = layui.popup;
let layer = layui.layer;
let $ = layui.jquery;
- let captchaPath = "{{ url_for('system.passport.get_captcha') }}";
+ let captchaPath = "{{ url_for('system.passport.captcha') }}";
/**