From 0afd5bbb2c6804fd720b335afd0294e96cc23731 Mon Sep 17 00:00:00 2001 From: shiran <2488252513@qq.com> Date: Sat, 9 May 2026 18:23:42 +0800 Subject: [PATCH] =?UTF-8?q?fix(api):=20=E7=BB=9F=E4=B8=80API=E7=AB=AF?= =?UTF-8?q?=E7=82=B9=E8=B7=AF=E5=BE=84=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 统一所有API端点路径末尾添加斜杠,确保与后端API规范一致, 包括收藏、通知、景点和用户相关接口。 --- clients/api/favorite.js | 2 +- clients/api/notification.js | 2 +- clients/api/spot.js | 4 ++-- clients/api/user.js | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/clients/api/favorite.js b/clients/api/favorite.js index 708bd0f..fa04e2f 100644 --- a/clients/api/favorite.js +++ b/clients/api/favorite.js @@ -1,6 +1,6 @@ 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}`); diff --git a/clients/api/notification.js b/clients/api/notification.js index 061d874..d978eed 100644 --- a/clients/api/notification.js +++ b/clients/api/notification.js @@ -1,6 +1,6 @@ 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"); diff --git a/clients/api/spot.js b/clients/api/spot.js index c211920..1ad6fdc 100644 --- a/clients/api/spot.js +++ b/clients/api/spot.js @@ -1,13 +1,13 @@ import { get, post, put, del } from "@/utils/request"; 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 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); diff --git a/clients/api/user.js b/clients/api/user.js index 03bb7a7..4e62eaa 100644 --- a/clients/api/user.js +++ b/clients/api/user.js @@ -11,4 +11,4 @@ export const changePassword = (data) => post("/users/me/change-password", data); export const getUserInfo = (userId) => get(`/users/${userId}`); export const getUserSpots = (userId, params) => - get("/spots", { creator_id: userId, ...params }); + get("/spots/", { creator_id: userId, ...params });