|
|
@@ -3,6 +3,8 @@ import { get, post } from '@/utils/request'
|
|
|
const userApi = {
|
|
|
myInfoApi: '/api/user/info/my',
|
|
|
userInfoApi: '/api/user/info',
|
|
|
+ updateProfileApi: '/api/user/profile/basic',
|
|
|
+ updateAvatarApi: '/api/user/profile/avatar',
|
|
|
followUserApi: '/api/user/relation/follow',
|
|
|
unfollowUserApi: '/api/user/relation/unfollow',
|
|
|
checkRelationApi: '/api/user/relation/check',
|
|
|
@@ -21,6 +23,16 @@ export function getUserInfo(userId) {
|
|
|
return get(userApi.userInfoApi + '?userId=' + userId)
|
|
|
}
|
|
|
|
|
|
+// 更新用户资料
|
|
|
+export function updateProfile(data) {
|
|
|
+ return post(userApi.updateProfileApi, data)
|
|
|
+}
|
|
|
+
|
|
|
+// 更新用户头像
|
|
|
+export function updateAvatar(data) {
|
|
|
+ return post(userApi.updateAvatarApi, data)
|
|
|
+}
|
|
|
+
|
|
|
// 关注用户
|
|
|
export function followUser(followingId) {
|
|
|
return post(userApi.followUserApi + '/' + followingId)
|