diff --git a/Server/application/superadmin/data/administrator.sql b/Server/application/superadmin/data/administrator.sql deleted file mode 100644 index 02073d56d..000000000 --- a/Server/application/superadmin/data/administrator.sql +++ /dev/null @@ -1,2 +0,0 @@ -INSERT INTO `tk_administrators` (`name`, `account`, `password`, `status`, `createTime`, `updateTime`) -VALUES ('超级管理员', 'admin', MD5('123456'), 1, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()); \ No newline at end of file diff --git a/SuperAdmin/app/dashboard/page.tsx b/SuperAdmin/app/dashboard/page.tsx index 2daa9ee44..a183c5b7e 100644 --- a/SuperAdmin/app/dashboard/page.tsx +++ b/SuperAdmin/app/dashboard/page.tsx @@ -17,28 +17,26 @@ export default function DashboardPage() { const adminInfo = localStorage.getItem("admin_info") if (adminInfo) { try { - const { name } = JSON.parse(adminInfo) - setUserName(name || "管理员") + const userData = JSON.parse(adminInfo) + setUserName(userData.name || "管理员") } catch (err) { console.error("解析用户信息失败:", err) + setUserName("管理员") } } // 获取当前时间 const hour = new Date().getHours() - let timeGreeting = "" if (hour >= 5 && hour < 12) { - timeGreeting = "上午好" + setGreeting("上午好") } else if (hour >= 12 && hour < 14) { - timeGreeting = "中午好" + setGreeting("中午好") } else if (hour >= 14 && hour < 18) { - timeGreeting = "下午好" + setGreeting("下午好") } else { - timeGreeting = "晚上好" + setGreeting("晚上好") } - - setGreeting(timeGreeting) }, []) return ( diff --git a/SuperAdmin/app/login/page.tsx b/SuperAdmin/app/login/page.tsx index 0397d8140..5109a8404 100644 --- a/SuperAdmin/app/login/page.tsx +++ b/SuperAdmin/app/login/page.tsx @@ -11,7 +11,7 @@ import { Label } from "@/components/ui/label" import { md5 } from "@/lib/utils" export default function LoginPage() { - const [username, setUsername] = useState("") + const [account, setAccount] = useState("") const [password, setPassword] = useState("") const [isLoading, setIsLoading] = useState(false) const [error, setError] = useState("") @@ -33,7 +33,7 @@ export default function LoginPage() { "Content-Type": "application/json", }, body: JSON.stringify({ - account: username, + account, password: encryptedPassword }), credentials: "include" @@ -70,12 +70,12 @@ export default function LoginPage() {
- + setUsername(e.target.value)} + value={account} + onChange={(e) => setAccount(e.target.value)} required />