diff --git a/src/api/auth.ts b/src/api/auth.ts index 1ac19be0..eb904d87 100644 --- a/src/api/auth.ts +++ b/src/api/auth.ts @@ -35,16 +35,6 @@ class AuthAPI { method: "get", }); } - - /** - * 获取验证码规则 - */ - static getCaptchaRule() { - return request({ - url: `${AUTH_BASE_URL}/captcha/unable`, - method: "get", - }); - } } export default AuthAPI; diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 1c58a41b..7222319e 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -107,7 +107,7 @@ - +
(); -// 是否关闭验证码 -const closeCaptcha = ref(false); const logo = ref(new URL(`../../assets/logo.png`, import.meta.url).href); @@ -343,17 +341,8 @@ const setLoginCredentials = (username: string, password: string) => { loginData.value.password = password; }; -function getCaptchaRule() { - AuthAPI.getCaptchaRule().then((data) => { - closeCaptcha.value = data; - if (!closeCaptcha.value) { - getCaptcha(); - } - }); -} - onMounted(() => { - getCaptchaRule(); + getCaptcha(); });