From c4a9cad1c50e89365e2a58b50e259af642ed3b8c Mon Sep 17 00:00:00 2001 From: Codex Assistant <codex@example.com> Date: 星期二, 07 十月 2025 16:12:20 +0800 Subject: [PATCH] feat(review): 调整评审详情展示顺序与样式,描述支持多行,项目信息列宽40/60 fix(auth): 登录页与首页循环跳转保护;api.ts 在登录页不再重定向;401分支在登录页不跳转 fix(router): /login 放行策略优化,避免死循环;评审列表跳转到 /project-review/:id/detail fix(frontend): 补齐 utils/appConfig.ts,避免启动白屏 fix(review): 详情页提交评分缺少stageId时回退使用项目详情的stageId feat(backend): ActivityPlayerDetailResponse.playerInfo 补充 avatarUrl/avatar,服务组装时填充用户头像 chore(dev): 启动脚本注入本地JWT密钥,重启前后端 --- web/src/api/carousel.js | 44 +++++++++----------------------------------- 1 files changed, 9 insertions(+), 35 deletions(-) diff --git a/web/src/api/carousel.js b/web/src/api/carousel.js index 773f117..e28f364 100644 --- a/web/src/api/carousel.js +++ b/web/src/api/carousel.js @@ -1,30 +1,4 @@ -const GRAPHQL_ENDPOINT = 'http://localhost:8080/api/graphql' - -// GraphQL璇锋眰鍑芥暟 -async function graphqlRequest(query, variables = {}) { - const response = await fetch(GRAPHQL_ENDPOINT, { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - body: JSON.stringify({ - query, - variables, - }), - }) - - if (!response.ok) { - throw new Error(`HTTP error! status: ${response.status}`) - } - - const result = await response.json() - - if (result.errors) { - throw new Error(result.errors[0].message) - } - - return result.data -} +import { graphqlRequest } from '../config/api.ts' // GraphQL 鏌ヨ鍜屽彉鏇� const GET_CAROUSELS = ` @@ -103,26 +77,26 @@ export const CarouselApi = { // 鍒嗛〉鏌ヨ杞挱鍥� getCarousels: async (page = 0, size = 10, title) => { - const data = await graphqlRequest(GET_CAROUSELS, { page, size, title }) - return data.carousels + const result = await graphqlRequest(GET_CAROUSELS, { page, size, title }) + return result.data.carousels }, // 鏍规嵁ID鏌ヨ杞挱鍥� getCarousel: async (id) => { - const data = await graphqlRequest(GET_CAROUSEL, { id }) - return data.carousel + const result = await graphqlRequest(GET_CAROUSEL, { id }) + return result.data.carousel }, // 鑾峰彇鎾斁鍒楄〃 getPlayList: async () => { - const data = await graphqlRequest(GET_CAROUSEL_PLAY_LIST) - return data.carouselPlayList + const result = await graphqlRequest(GET_CAROUSEL_PLAY_LIST) + return result.data.carouselPlayList }, // 淇濆瓨杞挱鍥� saveCarousel: async (carousel) => { - const data = await graphqlRequest(SAVE_CAROUSEL, { carousel }) - return data.saveCarousel + const result = await graphqlRequest(SAVE_CAROUSEL, { carousel }) + return result.data.saveCarousel }, // 鍒犻櫎杞挱鍥� -- Gitblit v1.8.0