提交 | 用户 | 时间
|
820397
|
1 |
import request from '@/config/axios' |
H |
2 |
|
|
3 |
export interface ProfileVO { |
|
4 |
id: number |
|
5 |
username: string |
|
6 |
nickname: string |
|
7 |
dept: { |
|
8 |
id: number |
|
9 |
name: string |
|
10 |
} |
|
11 |
roles: { |
|
12 |
id: number |
|
13 |
name: string |
|
14 |
}[] |
|
15 |
posts: { |
|
16 |
id: number |
|
17 |
name: string |
|
18 |
}[] |
|
19 |
socialUsers: { |
|
20 |
type: number |
|
21 |
openid: string |
|
22 |
}[] |
|
23 |
email: string |
|
24 |
mobile: string |
|
25 |
sex: number |
|
26 |
avatar: string |
|
27 |
status: number |
|
28 |
remark: string |
|
29 |
loginIp: string |
|
30 |
loginDate: Date |
|
31 |
createTime: Date |
|
32 |
} |
|
33 |
|
|
34 |
export interface UserProfileUpdateReqVO { |
|
35 |
nickname: string |
|
36 |
email: string |
|
37 |
mobile: string |
|
38 |
sex: number |
|
39 |
} |
|
40 |
|
|
41 |
// 查询用户个人信息 |
|
42 |
export const getUserProfile = () => { |
|
43 |
return request.get({ url: '/system/user/profile/get' }) |
|
44 |
} |
|
45 |
|
|
46 |
// 修改用户个人信息 |
|
47 |
export const updateUserProfile = (data: UserProfileUpdateReqVO) => { |
|
48 |
return request.put({ url: '/system/user/profile/update', data }) |
|
49 |
} |
|
50 |
|
|
51 |
// 用户密码重置 |
|
52 |
export const updateUserPassword = (oldPassword: string, newPassword: string) => { |
|
53 |
return request.put({ |
|
54 |
url: '/system/user/profile/update-password', |
|
55 |
data: { |
|
56 |
oldPassword: oldPassword, |
|
57 |
newPassword: newPassword |
|
58 |
} |
|
59 |
}) |
|
60 |
} |
|
61 |
|
|
62 |
// 用户头像上传 |
|
63 |
export const uploadAvatar = (data) => { |
|
64 |
return request.upload({ url: '/system/user/profile/update-avatar', data: data }) |
|
65 |
} |