diff --git a/applications/common/admin/index_curd.py b/applications/common/admin/index_curd.py index ddaa1ce33f381932649081048a5aa1f5326f5d0c..f75bbefc6979fc603b281dd77c52b6875adba05b 100644 --- a/applications/common/admin/index_curd.py +++ b/applications/common/admin/index_curd.py @@ -28,21 +28,27 @@ def make_menu_tree(): # power1 = Power.query.filter( # Power.type == 1 # ).all() + # 获取当前用户的角色 role = current_user.role power0 = [] power1 = [] for i in role: + # 如果角色没有被启用就直接跳过 if i.enable == 0: continue + # 变量角色用户的权限 for p in i.power: + # 如果权限关闭了就直接跳过 if p.enable == 0: continue + # 一级菜单 if int(p.type) == 0: power0.append(p) + # 二级菜单 else: power1.append(p) - power_schema = PowerSchema(many=True) # 用已继承ma.ModelSchema类的自定制类生成序列化类 + power_schema = PowerSchema(many=True) # 用已继承 ma.ModelSchema 类的自定制类生成序列化类 power0_dict = power_schema.dump(power0) # 生成可序列化对象 power1_dict = power_schema.dump(power1) # 生成可序列化对象 power0_dict = sorted(power0_dict, key=lambda i: i['sort']) @@ -84,7 +90,7 @@ def get_render_config(): # 菜单配置 }, menu={ # 菜单数据来源 - "data": "/admin/menu", + "data": "/rights/menu", "collaspe": True, # 是否同时只打开一个菜单目录 "accordion": True, diff --git a/applications/common/utils/http.py b/applications/common/utils/http.py index 2a318777c8e41b57aeedd6e094f8d822ff869caa..75f4cd84c440b9602912c4a0dba4f9864bed0db2 100644 --- a/applications/common/utils/http.py +++ b/applications/common/utils/http.py @@ -3,18 +3,18 @@ from flask import jsonify def success_api(msg: str = "成功"): """ 成功响应 默认值”成功“ """ - return jsonify(success=True, message=msg) + return jsonify(success=True, msg=msg) def fail_api(msg: str = "失败"): """ 失败响应 默认值“失败” """ - return jsonify(success=False, message=msg) + return jsonify(success=False, msg=msg) def table_api(msg: str = "", count=0, data=None, limit=10): """ 动态表格渲染响应 """ res = { - 'message': msg, + 'msg': msg, 'code': 0, 'data': data, 'count': count, diff --git a/applications/configs/config.py b/applications/configs/config.py index bc40b9685d7c6d9030143529fb3c80f4a8290ea8..b40fb1015b42d1831017c06a5f29928bf5b82aa8 100644 --- a/applications/configs/config.py +++ b/applications/configs/config.py @@ -16,6 +16,8 @@ class BaseConfig: MYSQL_PORT = int(os.getenv('MYSQL_PORT') or 3306) MYSQL_DATABASE = os.getenv('MYSQL_DATABASE') or "PearAdminFlask" + UPLOADED_PHOTOS_DEST = '/static' + # mysql 数据库的配置信息 SQLALCHEMY_DATABASE_URI = f"mysql+pymysql://{MYSQL_USERNAME}:{MYSQL_PASSWORD}@{MYSQL_HOST}:{MYSQL_PORT}/{MYSQL_DATABASE}" # 默认日志等级 diff --git a/applications/extensions/__init__.py b/applications/extensions/__init__.py index bb47071bddbed5e80e25af19271caf88915ec667..67f315c8cc75382b4eb56119b28c60a626506eb3 100644 --- a/applications/extensions/__init__.py +++ b/applications/extensions/__init__.py @@ -8,7 +8,7 @@ from .init_error_views import init_error_views def init_plugs(app: Flask) -> None: - init_debug_tool(app) + # init_debug_tool(app) init_login_manager(app) init_databases(app) init_template_directives(app) diff --git a/applications/extensions/init_login.py b/applications/extensions/init_login.py index c4bf90a1c2dcdf782d46522fb745fa5bb816617f..50479128516908f2391bdec4beb4219f2f56996b 100644 --- a/applications/extensions/init_login.py +++ b/applications/extensions/init_login.py @@ -5,7 +5,7 @@ def init_login_manager(app): login_manager = LoginManager() login_manager.init_app(app) - login_manager.login_view = 'adminIndex.login' + login_manager.login_view = 'passport.login' login_manager.login_message = u'请登录以访问此页面' @login_manager.user_loader diff --git a/applications/templates/admin/admin_log/main.html b/applications/templates/admin/admin_log/main.html index 4958ab30632f0bd2334aaaf4dd7f66a9a181e054..cf5a1a87ece98f17c14f1fb592ab9cd920a29379 100644 --- a/applications/templates/admin/admin_log/main.html +++ b/applications/templates/admin/admin_log/main.html @@ -40,74 +40,74 @@ {% include 'admin/common/footer.html' %} \ No newline at end of file diff --git a/applications/templates/admin/common/header.html b/applications/templates/admin/common/header.html index 50bee36136d0da22eb5889ffb5f4a0911ad18eba..61721d1d7770cefd116e3f4fa785585df783645e 100644 --- a/applications/templates/admin/common/header.html +++ b/applications/templates/admin/common/header.html @@ -2,4 +2,4 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/applications/templates/admin/console/console.html b/applications/templates/admin/console/console.html index 78b99d311c6a165fc250aa1f120a6faec5211f5d..e266b686751b9e8788e0b2713529baf19baae4d7 100644 --- a/applications/templates/admin/console/console.html +++ b/applications/templates/admin/console/console.html @@ -1,356 +1,413 @@ - - 首页 - {% include 'admin/common/header.html' %} - + + 首页 + {% include 'admin/common/header.html' %} + - - - - -
-
-
-
-
今日访问
-
-
-
- 0 -
-
- - - - - - - - - -
-
-
-
-
-
-
-
提交次数
-
-
-
- 0 -
-
- - - - - - - - - - - - - -
-
-
-
-
-
-
-
下载数量
-
-
-
- 0 -
-
- - - - - - - - - - -
-
-
-
-
-
-
-
流量统计
-
-
-
- 0 -
-
- - - - - - - - - - - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
动态
-
-
-
-
-
-

七彩枫叶 在 Pear Admin 专区 回答问题

- 几秒前 -
-
-
-
-
-

简 在 Pear Admin 专区 进行了 提问

- 2天前 -
-
-
-
-
-

恒宇少年 将 Pear Admin 更新至 2.3.0 版本

- 7天前 -
-
-
-
-
-

如花 在 Pear Admin 社区 发布了 建议

- 7天前 -
-
-
-
-
-

就眠仪式 在 Pear Admin 社区 发布了 建议

- 8天前 -
-
-
-
-
-

贤心 在 Pear Admin 专区 进行了 提问

- 8天前 -
-
-
-
-
-
-
-
-
最近更新
-
-
    -
  • 优化代码格式2020-06-04 11:28
  • -
  • 新增消息组件2020-06-01 04:23
  • -
  • 移动端兼容2020-05-22 21:38
  • -
  • 系统布局优化2020-05-15 14:26
  • -
  • 兼容多系统菜单模式2020-05-13 16:32
  • -
  • 兼容多标签页切换2019-12-9 14:58
  • -
  • 扩展下拉组件2019-12-7 9:06
  • -
  • 扩展卡片样式2019-12-1 10:26
  • -
-
-
-
-
- 链接 -
-
- 官 网 -
- 下 载 -
- 后 端 -
-
-
-
-
- - {% include 'admin/common/footer.html' %} - - + }) + + \ No newline at end of file diff --git a/applications/templates/admin/dept/add.html b/applications/templates/admin/dept/add.html index 3941ee59bdf59979db4c2c7b9122205bdc2a007d..94ab9473e0f679b675d2e5b0dd89def89ea9860f 100644 --- a/applications/templates/admin/dept/add.html +++ b/applications/templates/admin/dept/add.html @@ -81,43 +81,43 @@ {% include 'admin/common/footer.html' %} diff --git a/applications/templates/admin/dept/edit.html b/applications/templates/admin/dept/edit.html index b003e0f97f4ce8b1faba068f17b58c553cefaca2..eabbe84b9c67c110006dfffd8cd16d69714068bf 100644 --- a/applications/templates/admin/dept/edit.html +++ b/applications/templates/admin/dept/edit.html @@ -26,21 +26,24 @@
-
-
-
@@ -48,16 +51,19 @@
- + - +
-
@@ -87,31 +93,31 @@ {% include 'admin/common/footer.html' %} diff --git a/applications/templates/admin/dept/main.html b/applications/templates/admin/dept/main.html index 58aa0864dee0e946719e60bb7b73250eded8dfef..f0733160e08cdb29a7a80a38e9661bc335e4688a 100644 --- a/applications/templates/admin/dept/main.html +++ b/applications/templates/admin/dept/main.html @@ -34,33 +34,36 @@ @@ -68,158 +71,159 @@ {% include 'admin/common/footer.html' %} \ No newline at end of file diff --git a/applications/templates/admin/dict/add.html b/applications/templates/admin/dict/add.html index a3d6d9e3e38014b1ebf462f9b31b6aa0d87da172..4722d80acf44e9307ef892b8e119d09449a397ea 100644 --- a/applications/templates/admin/dict/add.html +++ b/applications/templates/admin/dict/add.html @@ -55,31 +55,31 @@ {% include 'admin/common/footer.html' %} diff --git a/applications/templates/admin/dict/data/add.html b/applications/templates/admin/dict/data/add.html index ff9911eba167055f73114c52399c0246b0d37be1..794c4417f94a6042d96f69d41371de864c4a3ffa 100644 --- a/applications/templates/admin/dict/data/add.html +++ b/applications/templates/admin/dict/data/add.html @@ -26,7 +26,8 @@
-
@@ -62,31 +63,31 @@ {% include 'admin/common/footer.html' %} diff --git a/applications/templates/admin/dict/data/edit.html b/applications/templates/admin/dict/data/edit.html index a652618941587a855836ce1bc81f909f29fe4f20..a822fc3f00484824d7367a120179ebca400578b4 100644 --- a/applications/templates/admin/dict/data/edit.html +++ b/applications/templates/admin/dict/data/edit.html @@ -32,7 +32,7 @@
-
@@ -48,7 +48,7 @@
-
@@ -71,31 +71,31 @@ {% include 'admin/common/footer.html' %} diff --git a/applications/templates/admin/dict/edit.html b/applications/templates/admin/dict/edit.html index 45f202c1517531c2080c57d9881a96f2ce39ecf0..5e9c9dc9f46a531905f96775becba4052697d477 100644 --- a/applications/templates/admin/dict/edit.html +++ b/applications/templates/admin/dict/edit.html @@ -12,21 +12,21 @@
-
-
-
@@ -42,8 +42,8 @@
- +
@@ -63,33 +63,33 @@ - {% include 'admin/common/footer.html' %} +{% include 'admin/common/footer.html' %} diff --git a/applications/templates/admin/dict/main.html b/applications/templates/admin/dict/main.html index b86e5301192b3a8b6b613f18cc0dcc06dfe94e39..bfe2f327664917a18e9811275212c6564dff14dd 100644 --- a/applications/templates/admin/dict/main.html +++ b/applications/templates/admin/dict/main.html @@ -38,7 +38,29 @@
- + + + + + + + + + + + + + + + +
@@ -70,8 +92,8 @@ {% include 'admin/common/footer.html' %} \ No newline at end of file diff --git a/applications/templates/admin/index.html b/applications/templates/admin/index.html index 0b9280e392bf774c198c0e9da3446ceae62d078e..6fd29d2a7b1709bbe6bf7cbde43016feee99885b 100644 --- a/applications/templates/admin/index.html +++ b/applications/templates/admin/index.html @@ -24,10 +24,12 @@