From 45874b17eecc9cba74fc9961e4691fbf5507a53d Mon Sep 17 00:00:00 2001 From: zhengxinonly Date: Thu, 16 Jun 2022 23:21:15 +0800 Subject: [PATCH] update readme.md --- README.md | 3 +-- applications/view/index.py | 3 +-- config.py | 4 ++-- templates/view/system/user_edit.html | 3 ++- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index ab22b8a..0ce5ea4 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,6 @@ Pear Admin Flask 基于 Flask 生态的后台管理系统,该项目旨在为 p + [flask](https://dormousehole.readthedocs.io/en/latest/) + [flask-login](https://flask-login.readthedocs.io/en/latest/) + [flask-sqlalchemy](http://www.pythondoc.com/flask-sqlalchemy/quickstart.html) -+ [flask-restful](https://flask-restful.readthedocs.io/en/latest/) ## 预览 @@ -52,7 +51,7 @@ Pear Admin Flask 有以下几个版本: [Mini 分支版本 ](https://gitee.com/pear-admin/pear-admin-flask/tree/mini/) ->flask 2.x + flask-sqlalchemy + Flask-restful + 基于角色的权限管理 +>flask 2.x + flask-sqlalchemy + 基于角色的权限管理 | | | |---------------------|---------------------| diff --git a/applications/view/index.py b/applications/view/index.py index d6f9f2c..611db48 100644 --- a/applications/view/index.py +++ b/applications/view/index.py @@ -5,13 +5,12 @@ from flask_login import current_user, logout_user, login_required from common.gen_captcha import get_captcha_image -# 获取验证码 - index_bp = Blueprint('index', __name__) @index_bp.route('/') @index_bp.route('/admin') +@login_required def index(): return render_template('index.html') diff --git a/config.py b/config.py index ccf8ca2..310223f 100644 --- a/config.py +++ b/config.py @@ -35,11 +35,11 @@ REDIS_HOST = "127.0.0.1" REDIS_PORT = 6379 """ Sqlalchemy 配置 """ -# SQLALCHEMY_DATABASE_URI = r'sqlite:///pear_admin.db' +SQLALCHEMY_DATABASE_URI = r'sqlite:///pear_admin.db' SQLALCHEMY_TRACK_MODIFICATIONS = True SQLALCHEMY_ECHO = False SQLALCHEMY_POOL_RECYCLE = 8 -SQLALCHEMY_DATABASE_URI = f"mysql+pymysql://{MYSQL_USERNAME}:{MYSQL_PASSWORD}@{MYSQL_HOST}:{MYSQL_PORT}/{MYSQL_DATABASE}" +# SQLALCHEMY_DATABASE_URI = f"mysql+pymysql://{MYSQL_USERNAME}:{MYSQL_PASSWORD}@{MYSQL_HOST}:{MYSQL_PORT}/{MYSQL_DATABASE}" LOG_LEVEL = logging.ERROR diff --git a/templates/view/system/user_edit.html b/templates/view/system/user_edit.html index 580b681..c7132aa 100644 --- a/templates/view/system/user_edit.html +++ b/templates/view/system/user_edit.html @@ -77,9 +77,10 @@ let $ = layui.jquery; let dtree = layui.dtree; + // TODO 加载修改是会卡死 dtree.renderSelect({ elem: '#selectParent', - url: '/api/v1/dept/department', + url: '/api/v1/dept/department/', method: 'get', selectInputName: {nodeId: 'deptId', context: 'deptName'}, skin: 'layui',