diff --git a/app/admin/tags/create-tag-form.tsx b/app/admin/tags/create-tag-form.tsx
index c483d87..1d8a433 100644
--- a/app/admin/tags/create-tag-form.tsx
+++ b/app/admin/tags/create-tag-form.tsx
@@ -27,7 +27,7 @@ const schema = z.object({
slug: z.string().min(1, "别名不能为空"),
description: z.string().optional(),
color: z.string().optional(),
- isActive: z.boolean().default(true),
+ isActive: z.boolean(),
})
export default function CreateTagForm() {
diff --git a/app/api/login/route.ts b/app/api/login/route.ts
index 9b81d79..c3d9107 100644
--- a/app/api/login/route.ts
+++ b/app/api/login/route.ts
@@ -39,6 +39,7 @@ export async function POST(request: NextRequest) {
} catch (error) {
+ console.log(process.env.GRAPHQL_BACKEND_URL)
console.error('Login error:', error);
return NextResponse.json(
diff --git a/app/api/site/route.ts b/app/api/site/route.ts
index ea8cea1..af75e49 100644
--- a/app/api/site/route.ts
+++ b/app/api/site/route.ts
@@ -12,7 +12,7 @@ const GET_CONFIGS = gql`
`
export async function GET(request: NextRequest) {
- const client = new GraphQLClient(process.env.GRAPHQL_URL || 'http://localhost:3050/graphql');
+ const client = new GraphQLClient(process.env.GRAPHQL_BACKEND_URL || 'http://localhost:3050/graphql');
try {
const data: any = await client.request(GET_CONFIGS);
return NextResponse.json(data.siteConfigs);
diff --git a/app/tl.tsx b/app/tl.tsx
index 7d6f87d..5ee6b83 100644
--- a/app/tl.tsx
+++ b/app/tl.tsx
@@ -164,7 +164,7 @@ export const Timeline: React.FC
= React.memo(({
},
onDateChange: async (date: Date) => {
const datestr = formatInTimeZone(date, 'UTC', 'yyyyMMddHHmmss')
- const url_base = process.env.GRAPHQL_BACKEND_URL || 'http://localhost:3050'
+ const url_base = process.env.GRAPHQL_BACKEND_URL?.replace('/graphql', '') || 'http://localhost:3050'
const response = await fetch(`${url_base}/api/v1/data/nearest?datetime=${datestr}&area=cn`)
setTimelineTime(date)
diff --git a/components/map-component.tsx b/components/map-component.tsx
index 02c1912..e23d878 100644
--- a/components/map-component.tsx
+++ b/components/map-component.tsx
@@ -58,7 +58,7 @@ export function MapComponent({
useEffect(() => {
if (!isMapReady || !currentDatetime) return;
const utc_time_str = formatInTimeZone(currentDatetime, 'UTC', 'yyyyMMddHHmmss')
- const new_url_prefix = process.env.GRAPHQL_BACKEND_URL || 'http://localhost:3050'
+ const new_url_prefix = process.env.GRAPHQL_BACKEND_URL?.replace('/graphql', '') || 'http://localhost:3050'
const new_url = `${new_url_prefix}/api/v1/data?datetime=${utc_time_str}&area=cn`
fetchRadarTile(new_url)
}, [currentDatetime, isMapReady])
diff --git a/components/tiptap-templates/simple/enhanced-simple-editor.tsx b/components/tiptap-templates/simple/enhanced-simple-editor.tsx
index 69f3249..d5132ee 100644
--- a/components/tiptap-templates/simple/enhanced-simple-editor.tsx
+++ b/components/tiptap-templates/simple/enhanced-simple-editor.tsx
@@ -248,7 +248,7 @@ export function EnhancedSimpleEditor({ content, onChange }: EnhancedSimpleEditor
// Only update if content actually changed to avoid infinite loops
if (JSON.stringify(currentContent) !== JSON.stringify(newContent)) {
- editor.commands.setContent(newContent, false)
+ editor.commands.setContent(newContent, { emitUpdate: false })
}
}
}, [editor, content])
diff --git a/lib/apollo-client.ts b/lib/apollo-client.ts
index b6578a0..57a39e6 100644
--- a/lib/apollo-client.ts
+++ b/lib/apollo-client.ts
@@ -8,11 +8,12 @@ import { createClient } from 'graphql-ws';
const TOKEN_KEY = 'auth_token';
const httpLink = createHttpLink({
- uri: "http://127.0.0.1:3050/graphql",
+ uri: process.env.GRAPHQL_BACKEND_URL || 'http://localhost:3050/graphql',
});
const wsLink = new GraphQLWsLink(createClient({
- url: "ws://127.0.0.1:3050/ws",
+ // url: "ws://127.0.0.1:3050/ws",
+ url: process.env.GRAPHQL_BACKEND_URL?.replace('/graphql', '/ws')?.replace('http://', 'ws://') || 'ws://localhost:3050/ws',
}));
const authLink = setContext((_, { headers }) => {
diff --git a/lib/fetchers.ts b/lib/fetchers.ts
index 0ef5ec8..6574a0a 100644
--- a/lib/fetchers.ts
+++ b/lib/fetchers.ts
@@ -63,8 +63,32 @@ export async function fetchPage(slug: string, jwt?: string): Promise