feat: Phase 3 - API layer + Pinia stores + app integration

- HTTP client (axios interceptors, token mgmt, typed APIs)
- Pinia stores: token, user (login/logout), app (dark mode, sidebar)
- globalConfig TS types + Window augmentation
- Vue Router (hash history, auth guard)
- Login/Home/Mine pages (Vant UI)
- Vant integration + globalConfig dev script
- Build passes (vue-tsc + vite)
This commit is contained in:
2026-06-15 20:56:05 +08:00
parent 74cc0df2b8
commit 9b68a2d275
19 changed files with 2080 additions and 8 deletions

43
src/api/index.ts Normal file
View File

@@ -0,0 +1,43 @@
/**
* API 模块聚合入口
*
* 统一导出所有 API 子模块的方法和类型,业务代码只需
* `import { login, getUserInfo } from '@/api'` 即可使用。
*
* @module api
*/
// ── 用户模块 ──
export {
login,
getUserInfo,
logout,
resetPassword,
} from './user'
export type {
LoginParams,
LoginResult,
ResetPasswordParams,
UserInfo,
} from './user'
// ── 通用模块 ──
export {
uploadFile,
uploadFiles,
getDictData,
getDictDataByType,
getCaptcha,
getConfigValue,
getConfigItem,
} from './common'
export type {
UploadResult,
DictItem,
CaptchaResult,
ConfigItem,
} from './common'
// ── HTTP 工具(便捷导出) ──
export { getToken, setToken, removeToken } from '@/utils/http'
export type { ApiResponse } from '@/utils/http'