feat: 支持登录、个人信息存储
This commit is contained in:
31
assets/scripts/types/ApiTypes.ts
Normal file
31
assets/scripts/types/ApiTypes.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* 服务端 API 通用响应类型
|
||||
*/
|
||||
|
||||
/** 服务端标准响应封装 */
|
||||
export interface ApiEnvelope<T> {
|
||||
success: boolean;
|
||||
data: T | null;
|
||||
message: string | null;
|
||||
}
|
||||
|
||||
/** 登录响应数据 */
|
||||
export interface WxLoginData {
|
||||
token: string;
|
||||
user: {
|
||||
id: string;
|
||||
nickname: string | null;
|
||||
points: number;
|
||||
};
|
||||
}
|
||||
|
||||
/** 积分响应数据 */
|
||||
export interface UserAssetsData {
|
||||
points: number;
|
||||
}
|
||||
|
||||
/** 游戏数据响应(Loading 页面) */
|
||||
export interface GameData {
|
||||
user: { id: string; points: number };
|
||||
completedLevelIds: string[];
|
||||
}
|
||||
9
assets/scripts/types/ApiTypes.ts.meta
Normal file
9
assets/scripts/types/ApiTypes.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "13078ed9-43cf-4949-8a92-e702ee7de88a",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
Reference in New Issue
Block a user