diff --git a/dbm-ui/frontend/src/locales/zh-cn.json b/dbm-ui/frontend/src/locales/zh-cn.json index 384c65bc8c..42efe55d7b 100644 --- a/dbm-ui/frontend/src/locales/zh-cn.json +++ b/dbm-ui/frontend/src/locales/zh-cn.json @@ -3539,5 +3539,17 @@ "请输入或选择主机": "请输入或选择主机", "实例/IP重复": "实例/IP重复", "同主机关联的其他集群,勾选后一同克隆": "同主机关联的其他集群,勾选后一同克隆", + "开启弱密码检测": "开启弱密码检测", + "开启后,不允许超过 x 位连续字符,如出现以下示例密码将无法通过检测": "开启后,不允许超过 {x} 位连续字符,如出现以下示例密码将无法通过检测", + "连续键盘序_如_xx": "连续键盘序,如:{0}", + "连续字母序_如_xx": "连续字母序,如:{0}", + "连续数字序_如_xx": "连续数字序,如:{0}", + "连续特殊符号序_如_xx": "连续特殊符号序,如:{0}", + "重复的字母_数字_特殊符号_如_aa_bb_cc": "重复的字母、数字、特殊符号,如:{0}、{1}、{2}", + "密码组成设置": "密码组成设置", + "特殊字符(非空格)": "特殊字符(非空格)", + "密码校验": "密码校验", + "包含上述任意": "包含上述任意", + "指定特殊字符": "指定特殊字符", "这行勿动!新增翻译请在上一行添加!": "" } \ No newline at end of file diff --git a/dbm-ui/frontend/src/services/source/permission.ts b/dbm-ui/frontend/src/services/source/permission.ts index 2eab202aac..eb130b4172 100644 --- a/dbm-ui/frontend/src/services/source/permission.ts +++ b/dbm-ui/frontend/src/services/source/permission.ts @@ -53,8 +53,8 @@ interface AdminPasswordResultItem { /** * 查询密码安全策略 */ -export const getPasswordPolicy = (params = {}, payload = {} as IRequestPayload) => - http.get('/apis/conf/password_policy/get_password_policy/', params, payload); +export const getPasswordPolicy = (params: { name: string }) => + http.get('/apis/conf/password_policy/get_password_policy/', params); /** * 更新密码安全策略 diff --git a/dbm-ui/frontend/src/services/types/permission.ts b/dbm-ui/frontend/src/services/types/permission.ts index 0b3d40278c..1d865130a0 100644 --- a/dbm-ui/frontend/src/services/types/permission.ts +++ b/dbm-ui/frontend/src/services/types/permission.ts @@ -91,17 +91,13 @@ export interface PasswordPolicy { id: number; name: string; rule: { - include_rule: PasswordPolicyIncludeRule; - exclude_continuous_rule: { - limit: number; - letters: boolean; - numbers: boolean; - repeats: boolean; - symbols: boolean; - keyboards: boolean; - }; + repeats: number; max_length: number; min_length: number; + include_rule: PasswordPolicyIncludeRule; + weak_password: boolean; + number_of_types: number; + symbols_allowed: string; }; creator?: string; create_time?: string; @@ -117,14 +113,6 @@ export interface PasswordPolicyIncludeRule { uppercase: boolean; } -// 密码策略 include_rule -export interface PasswordPolicyIncludeRule { - numbers: boolean; - symbols: boolean; - lowercase: boolean; - uppercase: boolean; -} - /** * 新增账号规则 */ diff --git a/dbm-ui/frontend/src/views/password-manage/policy/Index.vue b/dbm-ui/frontend/src/views/password-manage/policy/Index.vue index f88e4586de..2d8bf2621f 100644 --- a/dbm-ui/frontend/src/views/password-manage/policy/Index.vue +++ b/dbm-ui/frontend/src/views/password-manage/policy/Index.vue @@ -12,220 +12,26 @@ --> - diff --git a/dbm-ui/frontend/src/views/password-manage/policy/components/Content.vue b/dbm-ui/frontend/src/views/password-manage/policy/components/Content.vue new file mode 100644 index 0000000000..947d9ce78b --- /dev/null +++ b/dbm-ui/frontend/src/views/password-manage/policy/components/Content.vue @@ -0,0 +1,288 @@ + + + + + + + diff --git a/dbm-ui/frontend/src/views/password-manage/routes.ts b/dbm-ui/frontend/src/views/password-manage/routes.ts index 79b6a98ab1..8369cd467a 100644 --- a/dbm-ui/frontend/src/views/password-manage/routes.ts +++ b/dbm-ui/frontend/src/views/password-manage/routes.ts @@ -26,6 +26,7 @@ const routes: RouteRecordRaw[] = [ path: 'policy', meta: { navName: t('密码安全规则'), + fullscreen: true, }, component: () => import('@views/password-manage/policy/Index.vue'), },