This commit is contained in:
wangzzpeng
2026-09-28 09:27:51 +08:00
parent 7bc84bbe5e
commit 6eb2bfcbfd
25 changed files with 2887 additions and 0 deletions

19
src/api/user.ts Normal file
View File

@@ -0,0 +1,19 @@
// 用户资料接口(真实后端绑定)
// 后端:org.dromara.system.controller.system.SysUserController#profile → /system/user/profile
// 鉴权:需登录态
import { request } from '@/utils/request'
import type { UserProfileVo } from '@/types/business/user'
/**
* 当前登录用户资料(需求提报页预填联系人姓名 / 电话)。
*
* <p>⚠️ 后端返回的是 `R<Map>`,用户对象嵌在 **`data.user`** 里(同级还有 roles / posts),
* 不是平铺在 data 上——这里在 api 层解包,调用方拿到的是用户对象本身。</p>
*/
export async function getUserProfile(): Promise<UserProfileVo> {
const data = await request<{ user: UserProfileVo }>({
url: '/system/user/profile',
method: 'get',
})
return data.user
}