diff --git a/src/api/betaApplicationClient.ts b/src/api/betaApplicationClient.ts index f0ad467..39921b2 100644 --- a/src/api/betaApplicationClient.ts +++ b/src/api/betaApplicationClient.ts @@ -2,6 +2,7 @@ import { serverRequest } from "./serverConnection"; export interface BetaApplicationInput { name: string; + email: string; phone: string; wechat: string; industry: string; @@ -16,6 +17,7 @@ export interface BetaApplicationInput { wantFeature: string[]; selfStatement: string; signature: string; + applicationDate: string; agreeRules: boolean; } @@ -72,6 +74,7 @@ function normalizeApplication(raw: unknown): BetaApplicationItem { userId: readNumberOrNull(item.userId), username: readNullableString(item.username), name: readString(item.name), + email: readString(item.email), phone: readString(item.phone), wechat: readString(item.wechat), industry: readString(item.industry), @@ -86,6 +89,7 @@ function normalizeApplication(raw: unknown): BetaApplicationItem { wantFeature: readStringArray(item.wantFeature), selfStatement: readString(item.selfStatement), signature: readString(item.signature), + applicationDate: readString(item.applicationDate), agreeRules: item.agreeRules === true, status: normalizeStatus(item.status), inviteCode: readNullableString(item.inviteCode), diff --git a/src/components/BetaApplicationModal.tsx b/src/components/BetaApplicationModal.tsx index 850dff2..619082a 100644 --- a/src/components/BetaApplicationModal.tsx +++ b/src/components/BetaApplicationModal.tsx @@ -10,6 +10,7 @@ interface BetaApplicationModalProps { /* ── Form state ── */ interface BetaFormData { name: string; + email: string; phone: string; wechat: string; industry: string; @@ -24,11 +25,13 @@ interface BetaFormData { wantFeature: string[]; selfStatement: string; signature: string; + applicationDate: string; agreeRules: boolean; } const INITIAL_FORM: BetaFormData = { name: "", + email: "", phone: "", wechat: "", industry: "", @@ -43,6 +46,7 @@ const INITIAL_FORM: BetaFormData = { wantFeature: [], selfStatement: "", signature: "", + applicationDate: "", agreeRules: false, }; @@ -156,10 +160,12 @@ const BetaApplicationModal = ({ open, onClose }: BetaApplicationModalProps) => { const validate = () => { if (!form.name.trim()) return "请填写姓名 / 常用昵称"; + if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(form.email.trim())) return "请填写用于接收内测码的有效邮箱"; if (!form.phone.trim()) return "请填写联系手机号码"; if (!form.wechat.trim()) return "请填写微信账号"; if (!form.selfStatement.trim()) return "请填写申请自述"; if (!form.signature.trim()) return "请填写申请人确认签字"; + if (!form.applicationDate.trim()) return "请填写申请日期"; if (!form.agreeRules) return "请先阅读并同意内测规则"; return null; }; @@ -178,6 +184,7 @@ const BetaApplicationModal = ({ open, onClose }: BetaApplicationModalProps) => { await betaApplicationClient.submit({ ...form, name: form.name.trim(), + email: form.email.trim(), phone: form.phone.trim(), wechat: form.wechat.trim(), industry: form.industry.trim(), @@ -190,9 +197,10 @@ const BetaApplicationModal = ({ open, onClose }: BetaApplicationModalProps) => { feedbackWilling: form.feedbackWilling.trim(), selfStatement: form.selfStatement.trim(), signature: form.signature.trim(), + applicationDate: form.applicationDate.trim(), }); setForm(INITIAL_FORM); - setMessage({ tone: "success", text: "申请已提交,请留意站内通知。" }); + setMessage({ tone: "success", text: "申请已提交,请留意预留邮箱中的审核结果。" }); } catch (error) { setMessage({ tone: "error", text: error instanceof Error ? error.message : "提交内测申请失败" }); } finally { @@ -229,6 +237,7 @@ const BetaApplicationModal = ({ open, onClose }: BetaApplicationModalProps) => {
{selectedApplication.selfStatement || "未填写"}