feat(project): init

This commit is contained in:
2026-02-03 18:05:47 +08:00
commit f37a119eff
188 changed files with 29246 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
"use client"
import { userLogin } from "@/components/label/api/label"
import { usePermissionStore } from "@/components/label/store/auth"
import { Button } from "@mantine/core"
export default function ComponentLabelLoginPage() {
const { setUserInfo, setUserPassword } = usePermissionStore()
const user_id = usePermissionStore.getState().user_id
const token = usePermissionStore.getState().token
// 用户登录
const handleUserLoginBtnClick = async () => {
try {
const res = await userLogin({
name: "admin",
password: "123456",
})
const { uid, name, token, refresh_token } = res
setUserInfo({
user_id: uid,
user_name: name,
token,
refresh_token,
detailInfo: res,
})
setUserPassword("123456")
} catch (error) {
console.log(error)
}
}
return (
<>
<Button onClick={handleUserLoginBtnClick}>Login</Button>
user_id:{user_id}
token:{token}
</>
)
}