From 59672227de2973a8b9541b13f94595aea6f08a98 Mon Sep 17 00:00:00 2001 From: Tristan Yang Date: Thu, 4 May 2023 06:58:30 +0800 Subject: [PATCH] refactor: bot email --- src/routes/setting/BotConfig/CreateModal.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/routes/setting/BotConfig/CreateModal.tsx b/src/routes/setting/BotConfig/CreateModal.tsx index d99f4a9e..461d713c 100644 --- a/src/routes/setting/BotConfig/CreateModal.tsx +++ b/src/routes/setting/BotConfig/CreateModal.tsx @@ -6,6 +6,7 @@ import Modal from '../../../common/component/Modal'; import Button from '../../../common/component/styled/Button'; import Input from '../../../common/component/styled/Input'; import StyledModal from '../../../common/component/styled/Modal'; +import { BASE_ORIGIN } from '../../../app/config'; type Props = { closeModal: () => void @@ -35,11 +36,12 @@ const CreateModal = ({ closeModal }: Props) => { formDataObj[key] = value; } }); + const hostname = new URL(BASE_ORIGIN).hostname; createUser({ is_bot: true, is_admin: false, gender: 1, - email: `bot_${new Date().getTime()}@voce.chat`, + email: `bot_${new Date().getTime()}@${hostname}`, password: "", ...formDataObj });