diff --git a/package.json b/package.json index 42f3b0801b0fa0ecb8b0b5f59035ea1f006f2c00..ecb431788a6734736f627020380b2a2f285232b7 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "version": "3.4.0", "private": "true", "scripts": { + "bootstrap": "pnpm install --registry=https://registry.npmmirror.com", "dev": "vite --host", "build": "vue-tsc --noEmit && vite build", "build:test": "vue-tsc --noEmit && vite build --mode test", diff --git a/src/apis/auth/type.ts b/src/apis/auth/type.ts index 578010cd7a02962e1871588fe9bf4c01b22a688c..b154ea473b97a6953576948d8cb343ca973a05d5 100644 --- a/src/apis/auth/type.ts +++ b/src/apis/auth/type.ts @@ -45,6 +45,7 @@ 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 29ac1cba45c70f489d77769564140ce7801fab1f..5887f011c31a6d42c146e575f681c00ec7b4ab16 100644 --- a/src/apis/common/captcha.ts +++ b/src/apis/common/captcha.ts @@ -5,6 +5,11 @@ 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/system/type.ts b/src/apis/system/type.ts index c5fb7a6870428658c5d42b2debfc8ef1a455ca25..96e48d6fa2de40a5931c773e6f1925c593b84041 100644 --- a/src/apis/system/type.ts +++ b/src/apis/system/type.ts @@ -316,6 +316,11 @@ export interface SecurityConfig { PASSWORD_REQUIRE_SYMBOLS: OptionResp } +/** 安全配置类型 */ +export interface CaptchaSetting { + NEED_CAPTCHA: OptionResp +} + /** 绑定三方账号信息 */ export interface BindSocialAccountRes { source: string diff --git a/src/views/login/components/account/index.vue b/src/views/login/components/account/index.vue index 96e6c1a38f745b4771247a91c47227cbf36e308c..3590e4f1b9c0cd8e4d65a955f62c0c00f47d945d 100644 --- a/src/views/login/components/account/index.vue +++ b/src/views/login/components/account/index.vue @@ -1,18 +1,18 @@ diff --git a/src/views/system/config/components/CaptchaSetting.vue b/src/views/system/config/components/CaptchaSetting.vue new file mode 100644 index 0000000000000000000000000000000000000000..5c04e79d0d20bf06b8c2073169881ee4e26f8938 --- /dev/null +++ b/src/views/system/config/components/CaptchaSetting.vue @@ -0,0 +1,151 @@ + + + + + diff --git a/src/views/system/config/index.vue b/src/views/system/config/index.vue index 3b4541fb9f0664461681ee20d5667017c778d264..85089511aac80887f8e1fd75795b8bec7e6dff49 100644 --- a/src/views/system/config/index.vue +++ b/src/views/system/config/index.vue @@ -15,6 +15,9 @@ + + + @@ -27,6 +30,7 @@ import { useRoute, useRouter } from 'vue-router' import BasicSetting from './components/BasicSetting.vue' import MailSetting from './components/MailSetting.vue' import SecuritySetting from './components/SecuritySetting.vue' +import LoginSetting from './components/CaptchaSetting.vue' defineOptions({ name: 'SystemConfig' }) @@ -34,6 +38,7 @@ const PanMap: Record = { 1: BasicSetting, 2: MailSetting, 3: SecuritySetting, + 4: LoginSetting, } const route = useRoute()