feat: save play record using localstorage

This commit is contained in:
shinya
2025-06-19 21:00:47 +08:00
parent 660b51d9bd
commit e45feeb1a8
12 changed files with 782 additions and 112 deletions

View File

@@ -8,11 +8,23 @@ export interface ApiSite {
detail?: string;
}
export interface StorageConfig {
type: 'localstorage' | 'database';
database?: {
host?: string;
port?: number;
username?: string;
password?: string;
database?: string;
};
}
export interface Config {
cache_time?: number;
api_site: {
[key: string]: ApiSite;
};
storage?: StorageConfig;
}
export const API_CONFIG = {
@@ -62,3 +74,8 @@ export function getApiSites(): ApiSite[] {
key,
}));
}
export function getStorageConfig(): StorageConfig {
const config = getConfig();
return config.storage || { type: 'localstorage' };
}