Merge branch 'master' of https://gitee.com/pear-admin/pear-admin-flask into master
This commit is contained in:
@@ -60,6 +60,18 @@ def make_menu_tree():
|
|||||||
|
|
||||||
for p0 in power0_dict:
|
for p0 in power0_dict:
|
||||||
for p1 in power1_dict:
|
for p1 in power1_dict:
|
||||||
|
for p2 in power1_dict:
|
||||||
|
if p1.get('id') == p2.get('parent_id') and int(p2.get('type'))<2:
|
||||||
|
if p1.get("children") is None:
|
||||||
|
p1['children'] = []
|
||||||
|
p1['children'].append(p2)
|
||||||
|
else:
|
||||||
|
hassame = 0
|
||||||
|
for tmp in p1['children']:
|
||||||
|
if tmp.get('id') == p2.get('id'):
|
||||||
|
hassame =1
|
||||||
|
if hassame == 0:
|
||||||
|
p1['children'].append(p2)
|
||||||
if p0.get('id') == p1.get('parent_id'):
|
if p0.get('id') == p1.get('parent_id'):
|
||||||
if p0.get("children") is None:
|
if p0.get("children") is None:
|
||||||
p0['children'] = []
|
p0['children'] = []
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ class BaseConfig:
|
|||||||
MYSQL_PORT = int(os.getenv('MYSQL_PORT') or 3306)
|
MYSQL_PORT = int(os.getenv('MYSQL_PORT') or 3306)
|
||||||
MYSQL_DATABASE = os.getenv('MYSQL_DATABASE') or "PearAdminFlask"
|
MYSQL_DATABASE = os.getenv('MYSQL_DATABASE') or "PearAdminFlask"
|
||||||
|
|
||||||
UPLOADED_PHOTOS_DEST = '/static'
|
|
||||||
|
|
||||||
# mysql 数据库的配置信息
|
# mysql 数据库的配置信息
|
||||||
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}"
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ def update():
|
|||||||
@login_required
|
@login_required
|
||||||
def center():
|
def center():
|
||||||
user_info = current_user
|
user_info = current_user
|
||||||
user_logs = AdminLog.query.filter_by(url='/admin/login').filter_by(uid=current_user.id).order_by(
|
user_logs = AdminLog.query.filter_by(url='/passport/login').filter_by(uid=current_user.id).order_by(
|
||||||
desc(AdminLog.create_time)).limit(10)
|
desc(AdminLog.create_time)).limit(10)
|
||||||
return render_template('admin/user/center.html', user_info=user_info, user_logs=user_logs)
|
return render_template('admin/user/center.html', user_info=user_info, user_logs=user_logs)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user