Skip to content

Commit 200e8cd

Browse files
committed
feat:新增自定义开启忘记密码功能
1 parent e4b86c6 commit 200e8cd

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

dash-fastapi-backend/sql/dash-fastapi.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ CREATE TABLE `sys_config` (
107107
INSERT INTO `sys_config` VALUES (1, '主框架页-默认皮肤样式名称', 'sys.index.skinName', '#1890ff', 'Y', 'admin', '2023-05-23 16:13:34', 'admin', '2023-05-23 16:13:34', '蓝色 #1890ff');
108108
INSERT INTO `sys_config` VALUES (2, '账号自助-验证码开关', 'sys.account.captchaEnabled', 'true', 'Y', 'admin', '2023-05-23 16:13:34', 'admin', '2023-05-23 16:13:34', '是否开启验证码功能(true开启,false关闭)');
109109
INSERT INTO `sys_config` VALUES (3, '用户登录-黑名单列表', 'sys.login.blackIPList', '', 'Y', 'admin', '2023-05-23 16:13:34', '', NULL, '设置登录IP黑名单限制,多个匹配项以;分隔,支持匹配(*通配、网段)');
110+
INSERT INTO `sys_config` VALUES (4, '账号自助-是否开启忘记密码功能', 'sys.account.forgetUser', 'true', 'Y', 'admin', '2023-05-23 16:13:34', 'admin', '2023-05-23 16:13:34', '是否开启忘记密码功能(true开启,false关闭)');
110111

111112
-- ----------------------------
112113
-- Table structure for sys_dept

dash-fastapi-frontend/views/login.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,13 @@
77

88
def render_content():
99
captcha_enabled_info = query_config_list_api(config_key='sys.account.captchaEnabled')
10+
forget_enabled_info = query_config_list_api(config_key='sys.account.forgetUser')
1011
captcha_hidden = False
12+
forget_show = True
1113
if captcha_enabled_info.get('code') == 200:
1214
captcha_hidden = False if captcha_enabled_info.get('data') == 'true' else True
15+
if forget_enabled_info.get('code') == 200:
16+
forget_show = False if forget_enabled_info.get('data') == 'false' else True
1317

1418
return html.Div(
1519
[
@@ -139,7 +143,7 @@ def render_content():
139143
],
140144
align='center',
141145
size=240
142-
),
146+
) if forget_show else [],
143147
fac.AntdFormItem(
144148
fac.AntdButton(
145149
'登录',
@@ -176,7 +180,7 @@ def render_content():
176180
fac.AntdFooter(
177181
html.Div(
178182
fac.AntdText(
179-
'版权所有©2023 Dash-FastAPI',
183+
'版权所有©2023 Dash-FastAPI-Admin',
180184
style={
181185
'margin': '0'
182186
}

0 commit comments

Comments
 (0)