From 77901dbe20e61d77de097726d8d7aea8b13c3e69 Mon Sep 17 00:00:00 2001 From: jingrow Date: Fri, 27 Jun 2025 18:43:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0jingrow=E7=B3=BB=E7=BB=9Fapi?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/get-category/route.js | 2 +- app/api/get-component-data/route.js | 2 +- app/api/get-detailview-data/route.js | 2 +- app/api/get-listview-data/route.js | 2 +- app/api/get-menu/route.js | 2 +- app/api/get-page-data/route.js | 2 +- app/api/get-site-settings/route.js | 2 +- app/api/send-email/route.js | 2 +- utils/data.js | 14 +++++++------- utils/siteSettings.js | 2 +- 10 files changed, 16 insertions(+), 16 deletions(-) diff --git a/app/api/get-category/route.js b/app/api/get-category/route.js index 57c8b48..6014f21 100644 --- a/app/api/get-category/route.js +++ b/app/api/get-category/route.js @@ -12,7 +12,7 @@ export async function GET(request) { } const response = await axios.get( - `${JINGROW_SERVER_URL}/api/method/jsite.api.v1.get_category`, + `${JINGROW_SERVER_URL}/api/action/jsite.api.v1.get_category`, { params: { pagetype, name } } ); return Response.json(response.data, { status: response.status }); diff --git a/app/api/get-component-data/route.js b/app/api/get-component-data/route.js index 0d3fb7a..5b1e11f 100644 --- a/app/api/get-component-data/route.js +++ b/app/api/get-component-data/route.js @@ -47,7 +47,7 @@ export async function GET(request) { return Response.json({ error: '缺少component_name参数' }, { status: 400 }); } const response = await axios.get( - `${JINGROW_SERVER_URL}/api/method/jsite.api.v1.get_component_data`, + `${JINGROW_SERVER_URL}/api/action/jsite.api.v1.get_component_data`, { params: { component_name } } ); let data = response.data.message?.data || {}; diff --git a/app/api/get-detailview-data/route.js b/app/api/get-detailview-data/route.js index 82497b5..1bedd40 100644 --- a/app/api/get-detailview-data/route.js +++ b/app/api/get-detailview-data/route.js @@ -11,7 +11,7 @@ export async function GET(request) { return Response.json({ error: '缺少pagetype或slug参数' }, { status: 400 }); } const response = await axios.get( - `${JINGROW_SERVER_URL}/api/method/jsite.api.v1.get_detailview_data`, + `${JINGROW_SERVER_URL}/api/action/jsite.api.v1.get_detailview_data`, { params: { pagetype, slug } } ); const data = response.data.message?.data || {}; diff --git a/app/api/get-listview-data/route.js b/app/api/get-listview-data/route.js index ef1cb8e..d22d0aa 100644 --- a/app/api/get-listview-data/route.js +++ b/app/api/get-listview-data/route.js @@ -12,7 +12,7 @@ export async function GET(request) { return Response.json({ error: '缺少pagetype参数' }, { status: 400 }); } const response = await axios.get( - `${JINGROW_SERVER_URL}/api/method/jsite.api.v1.get_listview_data`, + `${JINGROW_SERVER_URL}/api/action/jsite.api.v1.get_listview_data`, { params: { pagetype, category, count } } ); const data = response.data.message?.data || []; diff --git a/app/api/get-menu/route.js b/app/api/get-menu/route.js index a750fcd..0363538 100644 --- a/app/api/get-menu/route.js +++ b/app/api/get-menu/route.js @@ -25,7 +25,7 @@ function buildMenuTree(items, parent = null, parentPath = "") { export async function GET(request) { try { const response = await axios.get( - `${JINGROW_SERVER_URL}/api/method/jsite.api.v1.get_menu` + `${JINGROW_SERVER_URL}/api/action/jsite.api.v1.get_menu` ); const items = response.data.message?.data || []; const menuTree = buildMenuTree(items); diff --git a/app/api/get-page-data/route.js b/app/api/get-page-data/route.js index 501ec37..0559425 100644 --- a/app/api/get-page-data/route.js +++ b/app/api/get-page-data/route.js @@ -67,7 +67,7 @@ export async function POST(request) { const params = { slug_list: JSON.stringify(slug_list), page }; if (page_size) params.page_size = page_size; const response = await axios.get( - `${JINGROW_SERVER_URL}/api/method/jsite.api.v1.get_page_data`, + `${JINGROW_SERVER_URL}/api/action/jsite.api.v1.get_page_data`, { params } ); const message = response.data.message; diff --git a/app/api/get-site-settings/route.js b/app/api/get-site-settings/route.js index 33408f2..26de1e4 100644 --- a/app/api/get-site-settings/route.js +++ b/app/api/get-site-settings/route.js @@ -6,7 +6,7 @@ const JINGROW_SERVER_URL = process.env.JINGROW_SERVER_URL; export async function GET(request) { try { const response = await axios.get( - `${JINGROW_SERVER_URL}/api/method/jsite.api.v1.get_site_settings`, + `${JINGROW_SERVER_URL}/api/action/jsite.api.v1.get_site_settings`, { headers: get_jingrow_api_headers() } ); const data = response.data.message?.data || {}; diff --git a/app/api/send-email/route.js b/app/api/send-email/route.js index ae7410b..5c126d6 100644 --- a/app/api/send-email/route.js +++ b/app/api/send-email/route.js @@ -10,7 +10,7 @@ export async function POST(request) { return Response.json({ error: 'Missing parameters: subject and content are required.' }, { status: 400 }); } const response = await axios.post( - `${JINGROW_SERVER_URL}/api/method/jsite.api.v1.send_email`, + `${JINGROW_SERVER_URL}/api/action/jsite.api.v1.send_email`, { subject, content } ); const message = response.data.message; diff --git a/utils/data.js b/utils/data.js index abaa259..b278a89 100644 --- a/utils/data.js +++ b/utils/data.js @@ -124,7 +124,7 @@ export async function getPageData({ if (page_size) params.page_size = page_size; const response = await axios.get( - `${JINGROW_SERVER_URL}/api/method/jsite.api.v1.get_page_data`, + `${JINGROW_SERVER_URL}/api/action/jsite.api.v1.get_page_data`, { params } ); @@ -158,7 +158,7 @@ export async function getPageData({ export async function getAllSlugs() { try { const response = await axios.get( - `${JINGROW_SERVER_URL}/api/method/jsite.api.v1.get_all_slugs` + `${JINGROW_SERVER_URL}/api/action/jsite.api.v1.get_all_slugs` ); const slugs = response.data.message?.data; if (!Array.isArray(slugs)) { @@ -186,7 +186,7 @@ export async function getAllSlugs() { export async function fetchComponentData(componentName) { try { const res = await axios.get( - `${JINGROW_SERVER_URL}/api/method/jsite.api.v1.get_component_data`, + `${JINGROW_SERVER_URL}/api/action/jsite.api.v1.get_component_data`, { params: { component_name: componentName }, } @@ -214,7 +214,7 @@ export async function fetchListViewData({ pagetype, category, count }) { if (count !== undefined && count !== null) params.count = String(count); const res = await axios.get( - `${JINGROW_SERVER_URL}/api/method/jsite.api.v1.get_listview_data`, + `${JINGROW_SERVER_URL}/api/action/jsite.api.v1.get_listview_data`, { params } ); @@ -234,7 +234,7 @@ export async function fetchListViewData({ pagetype, category, count }) { export async function fetchCategoryData({ pagetype, name }) { try { const res = await axios.get( - `${JINGROW_SERVER_URL}/api/method/jsite.api.v1.get_category`, + `${JINGROW_SERVER_URL}/api/action/jsite.api.v1.get_category`, { params: { pagetype, name } } ); return { data: res.data.message?.data || null }; @@ -254,7 +254,7 @@ export async function fetchCategoryData({ pagetype, name }) { export async function getMenuData() { try { const response = await axios.get( - `${JINGROW_SERVER_URL}/api/method/jsite.api.v1.get_menu` + `${JINGROW_SERVER_URL}/api/action/jsite.api.v1.get_menu` ); const items = response.data.message?.data || []; // 递归组装菜单树 @@ -285,7 +285,7 @@ export async function getMenuData() { export async function getSiteSettings() { try { const res = await axios.get( - `${JINGROW_SERVER_URL}/api/method/jsite.api.v1.get_site_settings`, + `${JINGROW_SERVER_URL}/api/action/jsite.api.v1.get_site_settings`, { headers: get_jingrow_api_headers() } ); return res.data?.message?.data || { diff --git a/utils/siteSettings.js b/utils/siteSettings.js index 8c58a4d..7fd567e 100644 --- a/utils/siteSettings.js +++ b/utils/siteSettings.js @@ -2,7 +2,7 @@ export async function getSiteSettings() { const JINGROW_SERVER_URL = process.env.JINGROW_SERVER_URL; const apiKey = process.env.JINGROW_API_KEY; const apiSecret = process.env.JINGROW_API_SECRET; - const url = `${JINGROW_SERVER_URL}/api/method/jsite.api.v1.get_site_settings`; + const url = `${JINGROW_SERVER_URL}/api/action/jsite.api.v1.get_site_settings`; try { const controller = new AbortController();