vitesse-yitisheng-web/project_codebase.md

52 lines
2.1 KiB
Markdown

### `src/service/api/score.ts`
- **Purpose**: API definitions for score management.
- **Methods**: `getScore`, `saveScore`.
- **Types**: `SaveScoreRequest`, `ScoreInfo`.
### `src/service/api/major.ts`
- **Purpose**: API definitions for user major recommendations.
- **Methods**: `getUserMajorList`.
- **Types**: `UserMajorListRequest`, `UserMajorListResponse`, `MajorItem`.
### `src/stores/user.ts`
- **Purpose**: Manages user session state.
- **State**: `token`, `userInfo`.
- **Actions**: `login` (calls API), `logout`, `setToken`, `setUserInfo`.
- **Persistence**: Loads/Saves state to `localStorage`.
### `src/stores/score.ts`
- **Purpose**: Manages user score state.
- **State**: `scoreInfo`.
- **Actions**: `fetchScore`, `saveScore`, `clearScore`.
### `src/components/TheNavigation.vue`
- **Updated**: Added integration with `userStore` and `scoreStore`. Displays user info and score info. Handles login/logout logic.
### `src/components/ScoreForm.vue`
- **Updated**: Integrated with `scoreStore` to load and save score data. Maps form state to backend API structure.
### `src/pages/index.vue`
- **Purpose**: Home page / Dashboard.
- **Features**: Displays user sidebar with score form (if logged in) or welcome/feature info (if not logged in).
### `src/pages/agreement.vue`
- **Purpose**: Displays the User Service Agreement.
- **Features**: Static content with company information and service terms. Responsive layout.
### `src/pages/privacy-policy.vue`
- **Purpose**: Displays the Privacy Policy.
- **Features**: Static content detailing data collection, usage, and protection. Includes contact information. Responsive layout.
### `src/service/api/volunteer.ts`
- **Purpose**: API definitions for volunteer filling management.
- **Methods**: `saveVolunteer`, `getVolunteerDetail`.
- **Types**: `VolunteerInfo`, `VolunteerItem`, `VolunteerDetailResponse`.
### `src/pages/simulate.vue`
- **Updated**:
- Integrated `getVolunteerDetail` and `saveVolunteer`.
- Implemented `isModified` state for unsaved changes detection.
- Added route leave protection and panel switch protection.
- Updated Panel B template to dynamic matching backend data structure.