mirror of
https://github.com/RuoJi6/ARTEX.git
synced 2026-12-07 05:11:51 +08:00
chore: ARTEX 初始化
ARTEX — AI 自主渗透测试系统(Go 后端 + Next.js 前端,单二进制内嵌)。 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This commit is contained in:
commit
0ef8561411
287 files changed
+70178
No files matched your search
@@ -0,0 +1,18 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
import { auth, type CurrentUser } from "@/lib/auth";
|
||||
|
||||
const FALLBACK: CurrentUser = { id: "1", name: "ARTEX", username: "artex", email: "", avatar: "", role: "operator" };
|
||||
|
||||
export function useCurrentUser(): CurrentUser {
|
||||
const [user, setUser] = useState<CurrentUser>(FALLBACK);
|
||||
|
||||
useEffect(() => {
|
||||
const u = auth.getCurrentUser();
|
||||
if (u) setUser(u);
|
||||
}, []);
|
||||
|
||||
return user;
|
||||
}
|
||||
Reference in new issue
Block a user