From 32599726a6a4db4b55780134872e1dcdd1baf227 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=8F=E6=B2=AB=E8=8A=B1=E7=81=ABzzz=F0=9F=8C=99?= Date: Sat, 30 Nov 2024 10:16:55 +0800 Subject: [PATCH 1/3] =?UTF-8?q?[*]=20Turnstile=20=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 5 ++-- src/api/v2/auth/login.api.ts | 5 ++-- src/views/auth/LoginView.vue | 57 +++++++++++++++--------------------- 3 files changed, 30 insertions(+), 37 deletions(-) diff --git a/package.json b/package.json index bbeb6da..c5f2097 100644 --- a/package.json +++ b/package.json @@ -10,11 +10,11 @@ "format": "prettier --write src/" }, "dependencies": { + "@vicons/fa": "^0.12.0", + "@vicons/fluent": "^0.12.0", "@vicons/ionicons4": "^0.12.0", "@vicons/ionicons5": "^0.12.0", "@vicons/material": "^0.12.0", - "@vicons/fa": "^0.12.0", - "@vicons/fluent": "^0.12.0", "axios": "^1.7.7", "highlight.js": "^11.10.0", "js-cookie": "^3.0.5", @@ -33,6 +33,7 @@ "vue-native-websocket": "^2.0.15", "vue-route": "^1.5.1", "vue-router": "^4.4.5", + "vue-turnstile": "^1.0.11", "vuex": "^4.1.0" }, "devDependencies": { diff --git a/src/api/v2/auth/login.api.ts b/src/api/v2/auth/login.api.ts index 01748d2..fad0b8b 100644 --- a/src/api/v2/auth/login.api.ts +++ b/src/api/v2/auth/login.api.ts @@ -2,10 +2,11 @@ import { post } from '@/utils/request' import base from '@/api/base' -const login = async (username: string, password: string) => { +const login = async (username: string, password: string, captcha_response_token: string) => { const rs = post(`${base.api_v2_url}/auth/login`, { username: username, - password: password + password: password, + captcha_response_token: captcha_response_token }) return base.buildResponse(await rs) } diff --git a/src/views/auth/LoginView.vue b/src/views/auth/LoginView.vue index d1c1412..03cb1ac 100644 --- a/src/views/auth/LoginView.vue +++ b/src/views/auth/LoginView.vue @@ -43,7 +43,18 @@ > 没有账户?去注册 - 登录 + 登录 + + + + @@ -53,7 +64,7 @@