blob: b8130ca0939311b56cccfb7a9b73e507fbb8a94b [file] [log] [blame]
TRM-coding29174c22025-06-18 23:56:51 +08001import axios from 'axios';
2
3const api = axios.create({
4 baseURL: 'http://10.126.59.25:5715/api/',
5 withCredentials: true
6});
7
8// 用户相关API
9export const getCurrentUser = () => api.get('/current-user');
10export const getUser = (userId) => api.get(`/user/${userId}`);
11export const updateUser = (userId, data) => api.put(`/user/${userId}`, data);
12
13// 收藏相关API
14export const getFavorites = (userId) => api.get(`/user/${userId}/favorites`);
15
16// 关注相关API
17export const followUser = (followeeId) => api.post(`/follow/${followeeId}`);
18export const unfollowUser = (followeeId) => api.delete(`/follow/${followeeId}`);
19
20// 帖子相关API
21export const getUserPosts = (userId) => api.get(`/user/${userId}/posts`);
22
23// 关注列表API
24export const getUserFollowing = (userId) => api.get(`/user/${userId}/following`);
25
26// 用户互动数据API
27export const getUserInteractions = (userId) => api.get(`/user/${userId}/interactions`);
28// 获取粉丝
29export const getUserFollowers = (userId) => api.get(`/user/${userId}/followers`);
30
31export default api;