From f05b12975c3d49d4002df6fdc414ec26212a266a Mon Sep 17 00:00:00 2001 From: archer <545436317@qq.com> Date: Sat, 27 May 2023 00:15:03 +0800 Subject: [PATCH] perf: google message --- src/utils/plugin/google.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/plugin/google.ts b/src/utils/plugin/google.ts index 366b8b6f1..aab791ce1 100644 --- a/src/utils/plugin/google.ts +++ b/src/utils/plugin/google.ts @@ -23,12 +23,12 @@ export const authGoogleToken = async (data: { response: string; remoteip?: string; }) => { - const res = await axios.post<{ score?: number; success: boolean }>( + const res = await axios.post<{ score?: number; success: boolean; 'error-codes': string[] }>( `https://www.recaptcha.net/recaptcha/api/siteverify?${Obj2Query(data)}` ); if (res.data.success && res.data.score && res.data.score >= 0.7) { return Promise.resolve(''); } - return Promise.reject('非法环境'); + return Promise.reject(res.data['error-codes'][0] || '非法环境'); };