更新管理员登录和鉴权逻辑,优化用户体验;重构相关API以支持更安全的身份验证;调整数据库初始化以兼容新字段,确保用户信息安全;修复部分组件样式和功能,提升整体可用性。
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
"use client"
|
||||
|
||||
import { useState } from "react"
|
||||
import Link from "next/link"
|
||||
import { X, Phone, Lock, User, Gift } from "lucide-react"
|
||||
import { Button } from "@/components/ui/button"
|
||||
import { Input } from "@/components/ui/input"
|
||||
@@ -60,7 +61,7 @@ export function AuthModal({ isOpen, onClose, defaultTab = "login" }: AuthModalPr
|
||||
setIsLoading(true)
|
||||
// 昵称可选,默认使用手机号后四位
|
||||
const name = nickname.trim() || `用户${phone.slice(-4)}`
|
||||
const success = await register(phone, name, referralCode || undefined)
|
||||
const success = await register(phone, name, password, referralCode || undefined)
|
||||
setIsLoading(false)
|
||||
|
||||
if (success) {
|
||||
@@ -146,6 +147,16 @@ export function AuthModal({ isOpen, onClose, defaultTab = "login" }: AuthModalPr
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="text-right">
|
||||
<Link
|
||||
href="/login/forgot"
|
||||
onClick={onClose}
|
||||
className="text-sm text-[#00CED1] hover:underline"
|
||||
>
|
||||
忘记密码?
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
{error && <p className="text-[#00CED1] text-sm">{error}</p>}
|
||||
|
||||
<Button
|
||||
|
||||
Reference in New Issue
Block a user