From 14ef3abb0d7f61948fc727566557d75e7cc5e2e7 Mon Sep 17 00:00:00 2001 From: Jagger <634750802@qq.com> Date: Mon, 6 Dec 2021 16:27:45 +0800 Subject: [PATCH] feat: remove recaptcha (#326) * feat: remove recaptcha * fix: remove params --- packages/accounts/index.html | 1 - packages/accounts/src/api/index.js | 24 ++++++++++---------- packages/accounts/vite.config.js | 1 + packages/datasource/src/api/account/index.js | 18 +++++---------- src/pages/my/layout/Layout.component.js | 7 ------ 5 files changed, 19 insertions(+), 32 deletions(-) diff --git a/packages/accounts/index.html b/packages/accounts/index.html index 7ae6bdc42..152a57618 100644 --- a/packages/accounts/index.html +++ b/packages/accounts/index.html @@ -18,6 +18,5 @@
- diff --git a/packages/accounts/src/api/index.js b/packages/accounts/src/api/index.js index 9e1aded5c..b3db71ae0 100644 --- a/packages/accounts/src/api/index.js +++ b/packages/accounts/src/api/index.js @@ -15,8 +15,8 @@ export const phoneLoginCheck = async ({ phone }) => { await client.post('/api/login/phone/check', { phone }); }; -export const sendCode = async (path, { phone, re_token_v3 }) => { - await client.post(`/api/${path}/send-code`, { phone, re_token_v3 }).catch(handleSendCodeLimitError); +export const sendCode = async (path, { phone }) => { + await client.post(`/api/${path}/send-code`, { phone }).catch(handleSendCodeLimitError); }; const postLogin = async ({ redirect_to, sso_callbacks }) => { @@ -29,13 +29,13 @@ const postLogin = async ({ redirect_to, sso_callbacks }) => { }; }; -export const phoneLogin = async ({ phone, code, re_token_v3, redirect_to }) => { - const { data: resp } = await client.post('/api/login/phone', { phone, code, re_token_v3, redirect_to }); +export const phoneLogin = async ({ phone, code, redirect_to }) => { + const { data: resp } = await client.post('/api/login/phone', { phone, code, redirect_to }); return postLogin(resp); }; -export const passwordLogin = async ({ identifier, password, re_token_v3, redirect_to }) => { - const { data: resp } = await client.post('/api/login/password', { identifier, password, re_token_v3, redirect_to }); +export const passwordLogin = async ({ identifier, password, redirect_to }) => { + const { data: resp } = await client.post('/api/login/password', { identifier, password, redirect_to }); return postLogin(resp); }; @@ -46,17 +46,17 @@ export const socialLogin = ({ provider, redirect_to }) => { ); }; -export const signup = async ({ company, email, phone, code, re_token_v3, redirect_to }) => { - const { data: resp } = await client.post('/api/signup', { company, email, phone, code, re_token_v3, redirect_to }); +export const signup = async ({ company, email, phone, code, redirect_to }) => { + const { data: resp } = await client.post('/api/signup', { company, email, phone, code, redirect_to }); return postLogin(resp); }; -export const forgetSendCode = async ({ identifier, re_token_v3 }) => { - await client.post(`/api/forget/send-code`, { identifier, re_token_v3 }).catch(handleSendCodeLimitError); +export const forgetSendCode = async ({ identifier }) => { + await client.post(`/api/forget/send-code`, { identifier }).catch(handleSendCodeLimitError); }; -export const forgetVerifyCode = async ({ identifier, code, re_token_v3 }) => { - return client.post('/api/forget/verify', { identifier, code, re_token_v3 }); +export const forgetVerifyCode = async ({ identifier, code }) => { + return client.post('/api/forget/verify', { identifier, code }); }; export const forgetResetPassword = async ({ new_password }) => { diff --git a/packages/accounts/vite.config.js b/packages/accounts/vite.config.js index 3d51cf52b..0711ba845 100644 --- a/packages/accounts/vite.config.js +++ b/packages/accounts/vite.config.js @@ -49,6 +49,7 @@ export default ({ mode }) => { alias: { '@/public': resolve(__dirname, '../../public'), '@': resolve(__dirname, '../../src'), + '@tidb-community/ui': resolve(__dirname, '../../packages/ui/es'), '~': resolve(__dirname, 'src'), ...unifyNodeModules([ 'antd', diff --git a/packages/datasource/src/api/account/index.js b/packages/datasource/src/api/account/index.js index 4d48c3ccb..5d5ef6799 100644 --- a/packages/datasource/src/api/account/index.js +++ b/packages/datasource/src/api/account/index.js @@ -2,41 +2,35 @@ import client from '../client'; export const settings = () => client.get('/api/account/settings'); -export const sendPhoneCode = ({ phone, re_token_v3 }) => +export const sendPhoneCode = ({ phone }) => client.post('/api/account/set-phone/send-code', { phone, - re_token_v3, }); -export const setPhone = ({ phone, code, re_token_v3 }) => +export const setPhone = ({ phone, code }) => client.post('/api/account/set-phone', { phone, code, - re_token_v3, }); -export const sendEmailCode = ({ email, re_token_v3 }) => +export const sendEmailCode = ({ email }) => client.post('/api/account/set-email/send-code', { email, - re_token_v3, }); -export const setEmail = ({ email, code, re_token_v3 }) => +export const setEmail = ({ email, code }) => client.post('/api/account/set-email', { email, code, - re_token_v3, }); -export const setPassword = ({ new_password, re_token_v3 }) => +export const setPassword = ({ new_password }) => client.post('/api/account/set-password', { new_password, - re_token_v3, }); -export const resetPassword = ({ old_password, new_password, re_token_v3 }) => +export const resetPassword = ({ old_password, new_password }) => client.post('/api/account/reset-password', { old_password, new_password, - re_token_v3, }); diff --git a/src/pages/my/layout/Layout.component.js b/src/pages/my/layout/Layout.component.js index e2a821c18..bc32d41ca 100644 --- a/src/pages/my/layout/Layout.component.js +++ b/src/pages/my/layout/Layout.component.js @@ -1,4 +1,3 @@ -import NextHead from 'next/head'; import React, { useEffect, useContext } from 'react'; import { Col, Row } from 'antd'; @@ -17,12 +16,6 @@ const Layout = ({ children, title }) => { return ( <> - - {process.env.NEXT_PUBLIC_RECAPTCHA_KEY && ( -