[feat] basic steam user parse

todo: steamid32 + avatar
This commit is contained in:
Purp1e
2025-03-23 21:55:17 +08:00
parent 03e5704a6e
commit 45e4ab1c6a
23 changed files with 6158 additions and 50 deletions

View File

@@ -10,7 +10,7 @@ export default function Page() {
<p>{steam.state.cs2Dir}</p>
<p>Steam路径有效{steam.state.steamDirValid ? "是" : "否"}</p>
<p>{steam.state.cs2DirValid ? "是" : "否"}</p>
<p>Steam账号{steam.currentUser()?.accountName || " "}</p>
<p>Steam账号{steam.currentUser()?.account_name || " "}</p>
</div>
)
}

View File

@@ -15,12 +15,18 @@ export default function RootLayout({ children }: { children: React.ReactNode })
const steam = useSteamStore()
const debounceSteamDir = useDebounce(steam.state.steamDir, {wait: 500, leading: true, trailing: true, maxWait: 2500})
const debounceCs2Dir = useDebounce(steam.state.cs2Dir, {wait: 500, leading: true, trailing: true, maxWait: 2500})
const debounceSteamDirValid = useDebounce(steam.state.steamDirValid, {wait: 500, leading: true, trailing: true, maxWait: 2500})
useEffect(() => {
void steam.checkSteamDirValid()
}, [debounceSteamDir])
useEffect(() => {
void steam.checkCs2DirValid()
}, [debounceCs2Dir])
useEffect(() => {
if (debounceSteamDirValid) {
void steam.getUsers()
}
}, [debounceSteamDirValid])
return (
<html lang="en">