feat: implement user authentication with login functionality

- Add auth-api for handling login requests.
- Update index.ts to export AuthApi.
- Modify HeroLayout to display username or login link based on authentication state.
- Create LoginPage component for user login.
- Update router to include login route with EmptyLayout.
- Configure WebClient to include credentials in requests.
- Add auth-slice for managing authentication state in Redux.
- Update Redux store to include auth reducer.
- Define LoginRequest and User types in types/index.ts.
- Configure Vite to proxy API requests to the backend server.
This commit is contained in:
2026-04-14 11:17:31 +08:00
parent b000336d22
commit ac76150915
12 changed files with 249 additions and 98 deletions
+5 -5
View File
@@ -18,13 +18,13 @@
"@tailwindcss/vite": "^4.2.2",
"@tanstack/react-virtual": "^3.13.23",
"antd": "^6.3.5",
"axios": "^1.14.0",
"axios": "^1.15.0",
"dayjs": "^1.11.20",
"react": "^19.2.5",
"react-dom": "^19.2.5",
"react-redux": "^9.2.0",
"react-router": "^7.14.0",
"react-router-dom": "^7.14.0",
"react-router": "^7.14.1",
"react-router-dom": "^7.14.1",
"redux-persist": "^6.0.0",
"tailwindcss": "^4.2.2"
},
@@ -33,8 +33,8 @@
"@types/react": "^19.2.14",
"@types/react-dom": "^19.2.3",
"@vitejs/plugin-react": "^6.0.1",
"globals": "^17.4.0",
"prettier": "^3.8.1",
"globals": "^17.5.0",
"prettier": "^3.8.2",
"typescript": "~6.0.2",
"vite": "^8.0.8"
},