refactor: update play time property and enhance player settings management

- Changed the play time property from 'play_time' to 'time' in HomeScreen.
- Removed unused player control functions from PlayScreen.
- Added PlayerSettings interface and implemented PlayerSettingsManager for local storage of player settings.
- Refactored PlayRecordManager to merge API records with local player settings.
- Updated authentication logic in authStore to handle optional username parameter in login function.
- Cleaned up and optimized imports across various components.
This commit is contained in:
zimplexing
2025-07-15 15:03:58 +08:00
parent 2bed3a4d00
commit bf99aee5f2
7 changed files with 152 additions and 56 deletions

View File

@@ -57,6 +57,7 @@ export interface PlayRecord {
play_time: number;
total_time: number;
save_time: number;
year: string;
}
export interface ApiSite {
@@ -108,7 +109,7 @@ export class API {
return response.json();
}
async login(username: string | undefined, password: string): Promise<{ ok: boolean }> {
async login(username?: string | undefined, password?: string): Promise<{ ok: boolean }> {
const response = await this._fetch("/api/login", {
method: "POST",
headers: { "Content-Type": "application/json" },