feat: 定义共享类型,改造用户 API(新增 wxLogin)

- 创建 src/api/types.ts,统一定义所有业务共享类型
- 改造 src/api/user.ts,类型迁移至 types.ts,新增 wxLogin 接口
- 更新 src/api/index.ts barrel 导出(card/order 模块待后续任务创建)
- 同步更新 src/store/user.ts 适配新的 WxLoginResult 返回结构

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
jacobxu666
2026-06-14 17:21:18 +08:00
co-authored by Claude Opus 4.8
parent c3896f9227
commit 4cd1040e5d
4 changed files with 114 additions and 21 deletions
+4 -3
View File
@@ -11,9 +11,10 @@ export const useUserStore = defineStore('user', () => {
async function login(params: LoginParams) {
const result = await apiLogin(params)
token.value = result.token
userInfo.value = result.userInfo
setToken(result.token)
token.value = result.accessToken
setToken(result.accessToken)
// 登录成功后获取用户信息
await fetchUserInfo()
return result
}