diff --git a/api/common.ts b/api/common.ts index 5139703..4fef3e8 100644 --- a/api/common.ts +++ b/api/common.ts @@ -49,6 +49,7 @@ export const getUploadToken = async (timeoutMs: number = 10000): Promise<{ token headers: { Accept: "application/json", "Content-Type": "application/json", + "Authorization": `Bearer ${localStorage.getItem("token")}` }, signal: controller.signal, mode: "cors", @@ -103,7 +104,7 @@ export const generateUniqueFileName = (originalName: string): string => { // 七牛云上传 export const uploadToQiniu = async ( - file: File, + file: File, token: string, onProgress?: (progress: number) => void ): Promise => { @@ -153,4 +154,4 @@ export const uploadToQiniu = async ( xhr.open("POST", "https://up-z2.qiniup.com") xhr.send(formData) }) -} \ No newline at end of file +} diff --git a/app/pricing/page.tsx b/app/pricing/page.tsx index 533b4e7..a79c0aa 100644 --- a/app/pricing/page.tsx +++ b/app/pricing/page.tsx @@ -181,44 +181,7 @@ function HomeModule5() { ))} - {/* 额外价格卡片 */} -
-
-

- Free -

-
- $0 -
-

- 10 Video mins and 1 AI credit per week, 1 Express avatar, 4 Exports - per week with invideo watermark. -

-

- No access to generative features. -

- -
-
-

- Enterprise -

-

Custom

-

- Custom solutions for large organizations. Advanced security and - flexible pricing based on your needs. -

-

- on your needs. -

- -
-
); } diff --git a/app/signup/page.tsx b/app/signup/page.tsx index 08b9db7..3c584c4 100644 --- a/app/signup/page.tsx +++ b/app/signup/page.tsx @@ -5,16 +5,20 @@ import { useRouter } from "next/navigation"; import Link from "next/link"; import { signInWithGoogle, registerUser } from "@/lib/auth"; import { GradientText } from "@/components/ui/gradient-text"; +import { Eye, EyeOff } from "lucide-react"; export default function SignupPage() { const [name, setName] = useState(""); const [email, setEmail] = useState(""); const [password, setPassword] = useState(""); + const [confirmPassword, setConfirmPassword] = useState(""); const [inviteCode, setInviteCode] = useState(""); const [isSubmitting, setIsSubmitting] = useState(false); const [formError, setFormError] = useState(""); const [passwordError, setPasswordError] = useState(""); + const [confirmPasswordError, setConfirmPasswordError] = useState(""); const [showPassword, setShowPassword] = useState(false); + const [showConfirmPassword, setShowConfirmPassword] = useState(false); const router = useRouter(); /** Password validation function with English prompts */ @@ -31,7 +35,7 @@ export default function SignupPage() { return ""; }; - /** 处理密码输入变化 */ + /** 处理密码输入变化 */ const handlePasswordChange = (e: React.ChangeEvent) => { const newPassword = e.target.value; setPassword(newPassword); @@ -42,9 +46,34 @@ export default function SignupPage() { } else { setPasswordError(""); } + + // 如果确认密码已输入,重新验证确认密码 + if (confirmPassword) { + if (newPassword !== confirmPassword) { + setConfirmPasswordError("Passwords do not match"); + } else { + setConfirmPasswordError(""); + } + } }; - const handleSubmit = async (e: React.FormEvent) => { + /** 处理确认密码输入变化 */ + const handleConfirmPasswordChange = (e: React.ChangeEvent) => { + const newConfirmPassword = e.target.value; + setConfirmPassword(newConfirmPassword); + + if (newConfirmPassword) { + if (password !== newConfirmPassword) { + setConfirmPasswordError("Passwords do not match"); + } else { + setConfirmPasswordError(""); + } + } else { + setConfirmPasswordError(""); + } + }; + + const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); // 验证密码 @@ -54,6 +83,12 @@ export default function SignupPage() { return; } + // 验证确认密码 + if (password !== confirmPassword) { + setConfirmPasswordError("Passwords do not match"); + return; + } + setIsSubmitting(true); setFormError(""); @@ -76,9 +111,6 @@ export default function SignupPage() { } }; - const handleGoogleSignIn = () => { - signInWithGoogle(); - }; return (
@@ -121,9 +153,9 @@ export default function SignupPage() { {/* 注册框 - 居中显示 */}
-
-
-

+
+
+

Sign Up, for free

Create your account to get started

@@ -158,40 +190,70 @@ export default function SignupPage() { />
-
- -
- - -
- {passwordError && ( -

{passwordError}

- )} - {password && !passwordError && ( -

✓ Password format is correct

- )} -

- Password requirements: 8-18 characters, must contain letters and numbers -

-
+
+ +
+ + +
+ +
+ +
+ + +
+
+ + {passwordError && ( +

{passwordError}

+ )} + {confirmPasswordError && ( +

{confirmPasswordError}

+ )} + {password && !passwordError && ( +

✓ Password format is correct

+ )} + {confirmPassword && !confirmPasswordError && ( +

✓ Passwords match

+ )} +