From 51a21688223346877f00f5142e277682e5774158 Mon Sep 17 00:00:00 2001 From: Charles7c Date: Thu, 5 Dec 2024 19:26:23 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=BC=98=E5=8C=96=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E9=AA=8C=E8=AF=81=E7=A0=81=E5=BC=80=E5=85=B3=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/auth/type.ts | 1 - src/apis/common/captcha.ts | 5 - src/apis/common/type.ts | 1 + src/apis/system/type.ts | 28 ++--- src/views/login/components/account/index.vue | 63 +++++----- .../{CaptchaSetting.vue => LoginSetting.vue} | 109 +++++++++--------- .../system/config/components/MailSetting.vue | 16 ++- src/views/system/config/index.vue | 18 +-- 8 files changed, 116 insertions(+), 125 deletions(-) rename src/views/system/config/components/{CaptchaSetting.vue => LoginSetting.vue} (50%) diff --git a/src/apis/auth/type.ts b/src/apis/auth/type.ts index b154ea4..578010c 100644 --- a/src/apis/auth/type.ts +++ b/src/apis/auth/type.ts @@ -45,7 +45,6 @@ export interface RouteItem { export interface AccountLoginReq { username: string password: string - unCaptcha: boolean captcha: string uuid: string } diff --git a/src/apis/common/captcha.ts b/src/apis/common/captcha.ts index 5887f01..29ac1cb 100644 --- a/src/apis/common/captcha.ts +++ b/src/apis/common/captcha.ts @@ -5,11 +5,6 @@ export type * from './type' const BASE_URL = '/captcha' -/** @desc 获取图片验证码 */ -export function getCaptchaConfig() { - return http.get(`${BASE_URL}/config`) -} - /** @desc 获取图片验证码 */ export function getImageCaptcha() { return http.get(`${BASE_URL}/image`) diff --git a/src/apis/common/type.ts b/src/apis/common/type.ts index 90f23cc..7d5db76 100644 --- a/src/apis/common/type.ts +++ b/src/apis/common/type.ts @@ -3,6 +3,7 @@ export interface ImageCaptchaResp { uuid: string img: string expireTime: number + isEnabled: boolean } /** 仪表盘公告类型 */ diff --git a/src/apis/system/type.ts b/src/apis/system/type.ts index 96e48d6..bcc9ba5 100644 --- a/src/apis/system/type.ts +++ b/src/apis/system/type.ts @@ -293,17 +293,6 @@ export interface SiteConfig { SITE_BEIAN: OptionResp } -/** 邮箱配置类型 */ -export interface MailConfig { - MAIL_PROTOCOL: OptionResp - MAIL_HOST: OptionResp - MAIL_PORT: OptionResp - MAIL_USERNAME: OptionResp - MAIL_PASSWORD: OptionResp - MAIL_SSL_ENABLED: OptionResp - MAIL_SSL_PORT: OptionResp -} - /** 安全配置类型 */ export interface SecurityConfig { PASSWORD_ERROR_LOCK_COUNT: OptionResp @@ -316,9 +305,20 @@ export interface SecurityConfig { PASSWORD_REQUIRE_SYMBOLS: OptionResp } -/** 安全配置类型 */ -export interface CaptchaSetting { - NEED_CAPTCHA: OptionResp +/** 邮箱配置类型 */ +export interface MailConfig { + MAIL_PROTOCOL: OptionResp + MAIL_HOST: OptionResp + MAIL_PORT: OptionResp + MAIL_USERNAME: OptionResp + MAIL_PASSWORD: OptionResp + MAIL_SSL_ENABLED: OptionResp + MAIL_SSL_PORT: OptionResp +} + +/** 登录配置类型 */ +export interface LoginConfig { + LOGIN_CAPTCHA_ENABLED: OptionResp } /** 绑定三方账号信息 */ diff --git a/src/views/login/components/account/index.vue b/src/views/login/components/account/index.vue index 3590e4f..af9a88f 100644 --- a/src/views/login/components/account/index.vue +++ b/src/views/login/components/account/index.vue @@ -1,18 +1,23 @@ diff --git a/src/views/system/config/components/CaptchaSetting.vue b/src/views/system/config/components/LoginSetting.vue similarity index 50% rename from src/views/system/config/components/CaptchaSetting.vue rename to src/views/system/config/components/LoginSetting.vue index 5c04e79..9cee395 100644 --- a/src/views/system/config/components/CaptchaSetting.vue +++ b/src/views/system/config/components/LoginSetting.vue @@ -1,53 +1,44 @@