diff --git a/frontend/src/app/admin/page.tsx b/frontend/src/app/admin/page.tsx index dad5e91..09e7a1b 100644 --- a/frontend/src/app/admin/page.tsx +++ b/frontend/src/app/admin/page.tsx @@ -2,7 +2,9 @@ import { FormEvent, useEffect, useState } from 'react'; -const API_URL = process.env.API_URL || 'http://localhost:24731'; +const API_URL = typeof window !== 'undefined' + ? (process.env.NEXT_PUBLIC_API_URL ?? '') + : (process.env.API_URL || 'http://localhost:24731'); const contentTypes = [ { value: 'page', label: '页面' }, { value: 'article', label: '文章' }, { value: 'case', label: '案例' }, { value: 'faq', label: '常见问题' }, { value: 'capability', label: '企业能力' }, { value: 'service', label: '服务' },