diff --git a/applications/__init__.py b/applications/__init__.py index 7a6ea03..2b47f44 100644 --- a/applications/__init__.py +++ b/applications/__init__.py @@ -30,29 +30,9 @@ def create_app(config_name=None): configure_uploads(app, photos) logo() - register_shell(app) return app -def register_shell(app: Flask): - @app.cli.command() - def create(): - """测试关系""" - from .extensions import db - from .models import Power, User - from .models import PowerSchema - power_schema = PowerSchema(many=True) # 用已继承 ma.ModelSchema 类的自定制类生成序列化类 - user = User.query.get(1) - power_list = [] - for role in user.role: - if role.enable: - for power in role.power: - # 权限被启用 - if power.enable and power: - power_list.append(power) - power_dict = sorted(power_list, key=lambda i: i['sort']) - - def logo(): print(''' _____ _ _ ______ _ _ diff --git a/applications/extensions/__init__.py b/applications/extensions/__init__.py index d248209..9b0765c 100644 --- a/applications/extensions/__init__.py +++ b/applications/extensions/__init__.py @@ -11,5 +11,5 @@ def init_plugs(app: Flask) -> None: init_login_manager(app) init_databases(app) init_template_directives(app) - init_error_views(app) + # init_error_views(app) register_script(app) diff --git a/applications/templates/admin/file/photo.html b/applications/templates/admin/file/photo.html index c194c56..ffe736b 100644 --- a/applications/templates/admin/file/photo.html +++ b/applications/templates/admin/file/photo.html @@ -10,6 +10,29 @@
+ + +{#添加文件内容#} + + {% include 'admin/common/footer.html' %} \ No newline at end of file + + \ No newline at end of file diff --git a/applications/templates/admin/file/photo_add.html b/applications/templates/admin/file/photo_add.html deleted file mode 100644 index 20d343b..0000000 --- a/applications/templates/admin/file/photo_add.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - {% include 'admin/common/header.html' %} - - - -
-
-
-
-
- 新增图片 -
-
-
- - - -
-
-
-
-
-
-{% include 'admin/common/footer.html' %} - - - \ No newline at end of file diff --git a/applications/templates/admin/login.html b/applications/templates/admin/login.html index 35c51c9..fc18b93 100644 --- a/applications/templates/admin/login.html +++ b/applications/templates/admin/login.html @@ -61,7 +61,7 @@ btn.stop(function () { if (result.success) { popup.success(result.msg, function () { - location.href = "{{ url_for('admin.index') }}" + location.href = "{{ url_for('index.admin_index') }}" }) } else { popup.failure(result.msg, function () { diff --git a/applications/templates/admin/user/avatar.html b/applications/templates/admin/user/avatar.html index 2d1f166..8ecacfa 100644 --- a/applications/templates/admin/user/avatar.html +++ b/applications/templates/admin/user/avatar.html @@ -65,7 +65,7 @@ formData.append('fileToken', timeStamp) $.ajax({ method: 'post', - url: '/admin/file/upload', //用于文件上传的服务器端请求地址 + url: '/file/upload', //用于文件上传的服务器端请求地址 data: formData, processData: false, contentType: false, diff --git a/applications/templates/index/index.html b/applications/templates/index/index.html index bb31903..86c53b5 100644 --- a/applications/templates/index/index.html +++ b/applications/templates/index/index.html @@ -23,10 +23,14 @@
- +
- +