From 098e51dde53a7fbf35198167297addb942dd109d Mon Sep 17 00:00:00 2001
From: moux1024 <403053463@qq.com>
Date: Sat, 18 Oct 2025 21:26:37 +0800
Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20SEO=20link?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/layout.tsx | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/app/layout.tsx b/app/layout.tsx
index 11ee832..b2219ff 100644
--- a/app/layout.tsx
+++ b/app/layout.tsx
@@ -2,11 +2,12 @@
import './globals.css';
import '@/iconfont/iconfont.css';
import { createContext, useContext, useEffect, useState } from 'react';
+import { usePathname } from 'next/navigation';
import { Providers } from '@/components/providers';
import { ConfigProvider, theme } from 'antd';
import CallbackModal from '@/components/common/CallbackModal';
import { useAppStartupAnalytics } from '@/hooks/useAppStartupAnalytics';
-import { gaEnabled, gaMeasurementId } from '@/lib/env';
+import { gaEnabled, gaMeasurementId, baseUrl } from '@/lib/env';
// 创建上下文来传递弹窗控制方法
const CallbackModalContext = createContext<{
@@ -29,6 +30,8 @@ export default function RootLayout({
}) {
const [showCallbackModal, setShowCallbackModal] = useState(false)
const [paymentType, setPaymentType] = useState<'subscription' | 'token'>('subscription')
+ const pathname = usePathname()
+ const canonicalHref = `https://movieflow.ai${pathname || ''}`
// 应用启动时设置用户GA属性
useAppStartupAnalytics();
@@ -53,7 +56,7 @@ export default function RootLayout({
-
+
{gaEnabled && (