From bc104b78942a0009370e9e1388df1ff8ee74f04c Mon Sep 17 00:00:00 2001 From: hqer927 <41457198+hqer927@users.noreply.github.com> Date: Tue, 10 Sep 2024 10:45:06 +0800 Subject: [PATCH] feat(web): add cross region user information authorize confirm (#2155) * feat(web): add cross region user information authorize confirm * feat: modify CN service domain * feat: add agreement about collect privacy has changed --- .github/workflows/deploy-web-dev-cn.yml | 3 + .github/workflows/deploy-web-prod-cn.yml | 3 + config/CN/.env.development | 2 +- config/CN/.env.production | 6 +- desktop/renderer-app/src/constants/process.ts | 4 +- .../LoginPage/LoginWithCode/index.tsx | 69 ++++++++++++++++- .../LoginPage/LoginWithPassword/index.tsx | 10 ++- .../src/components/RegisterModal/index.tsx | 10 ++- packages/flat-components/src/index.ts | 2 +- packages/flat-i18n/locales/en.json | 13 +++- packages/flat-i18n/locales/zh-CN.json | 13 +++- .../GeneralSettingPage/index.tsx | 48 +++++++++++- packages/flat-pages/src/constants/process.ts | 4 +- ...-room-handler.ts => join-room-handler.tsx} | 74 ++++++++++++++++++- packages/flat-server-api/src/constants.ts | 1 + packages/flat-server-api/src/login.ts | 21 ++++++ 16 files changed, 263 insertions(+), 20 deletions(-) rename packages/flat-pages/src/utils/{join-room-handler.ts => join-room-handler.tsx} (53%) diff --git a/.github/workflows/deploy-web-dev-cn.yml b/.github/workflows/deploy-web-dev-cn.yml index 5e27f742936..92c9566336f 100644 --- a/.github/workflows/deploy-web-dev-cn.yml +++ b/.github/workflows/deploy-web-dev-cn.yml @@ -29,7 +29,10 @@ jobs: cache: "pnpm" - name: Install dependencies + env: + FLAT_AGREEMENT_URL: ${{ vars.FLAT_AGREEMENT_URL }} run: | + echo "FLAT_AGREEMENT_URL=$FLAT_AGREEMENT_URL" >> config/CN/.env.development node ./scripts/ci/remove-workspace-packages.js web node ./scripts/ci/remove-package-scripts-hooks.js # failure automatically retries 3 times diff --git a/.github/workflows/deploy-web-prod-cn.yml b/.github/workflows/deploy-web-prod-cn.yml index d0c99ea3c94..fea0671308b 100644 --- a/.github/workflows/deploy-web-prod-cn.yml +++ b/.github/workflows/deploy-web-prod-cn.yml @@ -23,7 +23,10 @@ jobs: version: latest - name: Install dependencies + env: + FLAT_AGREEMENT_URL: ${{ vars.FLAT_AGREEMENT_URL }} run: | + echo "FLAT_AGREEMENT_URL=$FLAT_AGREEMENT_URL" >> config/CN/.env.production node ./scripts/ci/remove-workspace-packages.js web node ./scripts/ci/remove-package-scripts-hooks.js # failure automatically retries 3 times diff --git a/config/CN/.env.development b/config/CN/.env.development index 6cd5b67852c..d4d60181fa8 100644 --- a/config/CN/.env.development +++ b/config/CN/.env.development @@ -2,7 +2,7 @@ FLAT_SERVER_DOMAIN=flat-api-dev.whiteboard.agora.io UPDATE_DOMAIN=https://flat-storage.oss-cn-hangzhou.aliyuncs.com/versions FLAT_WEB_DOMAIN=flat-web-dev.whiteboard.agora.io -FLAT_DOWNLOAD_URL=https://www.flat.shengwang.cn/#download +FLAT_DOWNLOAD_URL=https://www.flat.apprtc.cn/#download FEEDBACK_URL=https://www.yuque.com/leooel/ec1kmm/vmsolg CLOUD_RECORDING_DEFAULT_AVATAR=https://flat-storage.oss-cn-hangzhou.aliyuncs.com/flat-resources/cloud-recording/default-avatar.jpg diff --git a/config/CN/.env.production b/config/CN/.env.production index 36c3ce2c2b2..01f4ddf4cd9 100644 --- a/config/CN/.env.production +++ b/config/CN/.env.production @@ -1,8 +1,8 @@ -FLAT_SERVER_DOMAIN=api.flat.shengwang.cn +FLAT_SERVER_DOMAIN=api.flat.apprtc.cn UPDATE_DOMAIN=https://flat-storage.oss-cn-hangzhou.aliyuncs.com/versions -FLAT_WEB_DOMAIN=web.flat.shengwang.cn +FLAT_WEB_DOMAIN=web.flat.apprtc.cn -FLAT_DOWNLOAD_URL=https://www.flat.shengwang.cn/#download +FLAT_DOWNLOAD_URL=https://www.flat.apprtc.cn/#download FEEDBACK_URL=https://www.yuque.com/leooel/ec1kmm/vmsolg CLOUD_RECORDING_DEFAULT_AVATAR=https://flat-storage.oss-cn-hangzhou.aliyuncs.com/flat-resources/cloud-recording/default-avatar.jpg diff --git a/desktop/renderer-app/src/constants/process.ts b/desktop/renderer-app/src/constants/process.ts index 7238b047490..6d4f512fa3b 100644 --- a/desktop/renderer-app/src/constants/process.ts +++ b/desktop/renderer-app/src/constants/process.ts @@ -5,8 +5,8 @@ export const FLAT_WEB_DOMAIN = process.env.FLAT_WEB_DOMAIN; export const FLAT_WEB_BASE_URL = `https://${FLAT_WEB_DOMAIN}`; -export const PRIVACY_URL_CN = "https://www.flat.shengwang.cn/privacy.html"; +export const PRIVACY_URL_CN = "https://www.flat.apprtc.cn/privacy.html"; export const PRIVACY_URL_EN = "https://flat.whiteboard.agora.io/en/privacy.html"; -export const SERVICE_URL_CN = "https://www.flat.shengwang.cn/service.html"; +export const SERVICE_URL_CN = "https://www.flat.apprtc.cn/service.html"; export const SERVICE_URL_EN = "https://flat.whiteboard.agora.io/en/service.html"; diff --git a/packages/flat-components/src/components/LoginPage/LoginWithCode/index.tsx b/packages/flat-components/src/components/LoginPage/LoginWithCode/index.tsx index a8f3b798bb5..3c441700e3e 100644 --- a/packages/flat-components/src/components/LoginPage/LoginWithCode/index.tsx +++ b/packages/flat-components/src/components/LoginPage/LoginWithCode/index.tsx @@ -14,6 +14,7 @@ import { LoginAccount, PasswordLoginType, defaultCountryCode } from "../LoginAcc import { LoginSendCode } from "../LoginSendCode"; import { phoneValidator } from "../LoginWithPassword/validators"; import { codeValidator } from "./validators"; +import { FLAT_AGREEMENT_URL } from "@netless/flat-server-api/src/constants"; export * from "../LoginButtons"; export * from "./validators"; @@ -197,7 +198,15 @@ export const LoginWithCode: React.FC = ({ checked={agreed} privacyURL={privacyURL} serviceURL={serviceURL} - onChange={setAgreed} + onChange={checked => { + if (checked) { + requestAgreement({ t, privacyURL, serviceURL }).then(agreed => { + setAgreed(agreed); + }); + } else { + setAgreed(false); + } + }} />