fix(api): 统一API端点路径格式
统一所有API端点路径末尾添加斜杠,确保与后端API规范一致, 包括收藏、通知、景点和用户相关接口。
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import { get, post, del } from "@/utils/request";
|
import { get, post, del } from "@/utils/request";
|
||||||
|
|
||||||
export const getFavorites = (params) => get("/favorites", params);
|
export const getFavorites = (params) => get("/favorites/", params);
|
||||||
|
|
||||||
export const addFavorite = (spotId) => post(`/favorites/${spotId}`);
|
export const addFavorite = (spotId) => post(`/favorites/${spotId}`);
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { get, post } from "@/utils/request";
|
import { get, post } from "@/utils/request";
|
||||||
|
|
||||||
export const getNotifications = (params) => get("/notifications", params);
|
export const getNotifications = (params) => get("/notifications/", params);
|
||||||
|
|
||||||
export const getUnreadCount = () => get("/notifications/unread-count");
|
export const getUnreadCount = () => get("/notifications/unread-count");
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,13 +1,13 @@
|
|||||||
import { get, post, put, del } from "@/utils/request";
|
import { get, post, put, del } from "@/utils/request";
|
||||||
import { API_BASE } from "@/utils/config";
|
import { API_BASE } from "@/utils/config";
|
||||||
|
|
||||||
export const getSpots = (params) => get("/spots", params);
|
export const getSpots = (params) => get("/spots/", params);
|
||||||
|
|
||||||
export const getNearbySpots = (params) => get("/spots/nearby", params);
|
export const getNearbySpots = (params) => get("/spots/nearby", params);
|
||||||
|
|
||||||
export const getSpotDetail = (id) => get(`/spots/${id}`);
|
export const getSpotDetail = (id) => get(`/spots/${id}`);
|
||||||
|
|
||||||
export const createSpot = (data) => post("/spots", data);
|
export const createSpot = (data) => post("/spots/", data);
|
||||||
|
|
||||||
export const updateSpot = (id, data) => put(`/spots/${id}`, data);
|
export const updateSpot = (id, data) => put(`/spots/${id}`, data);
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -11,4 +11,4 @@ export const changePassword = (data) => post("/users/me/change-password", data);
|
|||||||
export const getUserInfo = (userId) => get(`/users/${userId}`);
|
export const getUserInfo = (userId) => get(`/users/${userId}`);
|
||||||
|
|
||||||
export const getUserSpots = (userId, params) =>
|
export const getUserSpots = (userId, params) =>
|
||||||
get("/spots", { creator_id: userId, ...params });
|
get("/spots/", { creator_id: userId, ...params });
|
||||||
|
|||||||
Reference in New Issue
Block a user