Skip to content

Commit acd5e85

Browse files
committed
fix username logic
1 parent a3d18bf commit acd5e85

File tree

5 files changed

+20
-13
lines changed

5 files changed

+20
-13
lines changed

web/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="UTF-8" />
55
<link rel="icon" type="image/svg+xml" href="favicon.svg" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7-
<title>Vite App</title>
7+
<title>Camera AI</title>
88
</head>
99
<body>
1010
<div id="root"></div>

web/src/hooks/index.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ export const AuthProvider = (props: { children: ReactElement }) => {
103103

104104
const { count, rolePermissionData } = await GetMineRoleList();
105105

106+
setIsGetPermission(true);
107+
106108
setMineRoles({
107109
count: count ?? 0,
108110
rolePermissionData: rolePermissionData ?? [],

web/src/pages/login/index.tsx

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
11
import { UserOutlined } from "@ant-design/icons";
22
import { Button, ConfigProvider, Input } from "antd";
33

4-
import loginImg from "../../assets/login.png";
4+
import loginImage from "../../assets/login.png";
55
import { useAction } from "./hook";
66

77
export const Login = () => {
88
const { userInfo, loginLoading, handleOnLogin, updateUserInfo } = useAction();
99

1010
return (
11-
<div className="w-screen h-screen bg-[#2866F1] flex justify-end md:justify-normal">
12-
<div className="w-3/5 h-full hidden min-[75rem]:block">
11+
<div className="w-screen h-screen bg-[#2866F1] flex justify-end md:justify-normal overflow-hidden no-scrollbar">
12+
<div className="w-3/5 h-full hidden lg:block">
1313
<img
14-
src={loginImg}
14+
src={loginImage}
1515
alt=""
1616
className="w-full h-full bg-cover img-no-darg"
1717
/>
1818
</div>
19-
<div className="w-full min-[75rem]:w-2/5 lg:px-5 min-[75rem]:bg-white bg-[#2866F1] rounded-l-3xl box-border flex items-center justify-center relative">
20-
<div className="absolute flex min-[75rem]:hidden top-2 left-2 text-3xl text-white select-none">
19+
<div className="w-full lg:w-2/5 lg:px-5 lg:bg-white bg-[#2866F1] rounded-l-3xl box-border flex items-center justify-center relative">
20+
<div className="absolute flex lg:hidden top-2 left-2 text-3xl text-white select-none">
2121
<strong>CAMERA AI</strong>
2222
</div>
23-
<div className="w-96 h-[27.5rem] min-[75rem]:box-border box-content p-3 min-[75rem]:p-0 bg-white flex flex-col justify-center space-y-4 rounded-md min-[75rem]:rounded-none">
24-
<strong className="text-3xl select-none">Welcome</strong>
23+
<div className="w-96 h-[440px] lg:box-border box-content p-3 lg:p-0 bg-white flex flex-col justify-center space-y-4 rounded-md lg:rounded-none">
24+
<strong className="text-3xl select-none">Welcome,</strong>
2525
<Input
26-
placeholder="請輸入帳號"
26+
placeholder="Basic usage"
2727
size="large"
2828
prefix={<UserOutlined />}
2929
value={userInfo.userName}
3030
onChange={(e) => updateUserInfo("userName", e.target.value)}
3131
/>
3232
<Input.Password
33-
placeholder="請輸入密碼"
33+
placeholder="Basic usage"
3434
size="large"
3535
prefix={<UserOutlined />}
3636
value={userInfo.password}

web/src/pages/main/hook.ts

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export const useAction = () => {
1515
signOut,
1616
navigate,
1717
changeLanguage,
18+
userName,
1819
location,
1920
language,
2021
pagePermission,
@@ -107,6 +108,7 @@ export const useAction = () => {
107108
return {
108109
t,
109110
status,
111+
userName,
110112
language,
111113
handleOnJump,
112114
delModalStatus,

web/src/pages/main/index.tsx

+5-2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export const Main = () => {
3737
status,
3838
location,
3939
openKeys,
40+
userName,
4041
language,
4142
collapsed,
4243
passwordDto,
@@ -278,7 +279,7 @@ export const Main = () => {
278279
}}
279280
size="default"
280281
>
281-
{"".charAt(0)}
282+
{userName.charAt(0)}
282283
</Avatar>
283284
</div>
284285

@@ -288,7 +289,9 @@ export const Main = () => {
288289
onMouseLeave={() => setStatus(false)}
289290
>
290291
<div className="flex relative items-center space-x-1 cursor-pointer w-[5.5rem] justify-center">
291-
<div className="text-sm relative select-none w-16 text-center truncate" />
292+
<div className="text-sm relative select-none w-16 text-center truncate">
293+
{userName}
294+
</div>
292295
<img
293296
src={chevronDownImg}
294297
alt=""

0 commit comments

Comments
 (0)