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:
43
src/api/index.ts
Normal file
43
src/api/index.ts
Normal 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'
|
||||
Reference in New Issue
Block a user