diff --git a/src/constants/index.ts b/src/constants/index.ts index d5bb8b4..3c77dcc 100644 --- a/src/constants/index.ts +++ b/src/constants/index.ts @@ -18,6 +18,8 @@ export const ROUTES = { LEGAL: "/legal", CONTENT: "/content", CONTENT_PAGE: "/content/page", + CONTENT_PRIVACY_POLICY: "/content/privacy-policy", + CONTENT_USER_TERMS: "/content/user-terms", NOT_FOUND: "/404", } as const; diff --git a/src/dialog/LoginRegisterModal/index.tsx b/src/dialog/LoginRegisterModal/index.tsx index a0abd1c..17592dc 100644 --- a/src/dialog/LoginRegisterModal/index.tsx +++ b/src/dialog/LoginRegisterModal/index.tsx @@ -523,11 +523,11 @@ export function LoginRegisterModal({ onClose, onSelect }: LoginRegisterModalProp

{t("auth.agreement_sub1")} - + 《{t("app.user_terms")}》 {t("auth.agreement_sub2")} - + 《{t("app.privacy_policy")}》

@@ -571,11 +571,11 @@ export function LoginRegisterModal({ onClose, onSelect }: LoginRegisterModalProp > {t("auth.agreement_sub1")} - + 《{t("app.user_terms")}》 {t("auth.agreement_sub2")} - + 《{t("app.privacy_policy")}》 {t("auth.agreement_sub3")} diff --git a/src/dialog/points-recharge/index.tsx b/src/dialog/points-recharge/index.tsx index 7284ee0..f0c45f3 100644 --- a/src/dialog/points-recharge/index.tsx +++ b/src/dialog/points-recharge/index.tsx @@ -1,6 +1,7 @@ import { Message } from "@arco-design/web-react"; import { useCallback, useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; +import { ROUTES } from "@/constants"; import { getParamConfig, getPointPackageList } from "@/api/api"; import { useUserStore } from "@/store/useUserStore"; import { useCopyText } from "@/hooks/useCopyText"; @@ -134,7 +135,7 @@ export default function PointsRecharge({ title }: PointsRechargeProps) { {t("points_recharge.tip_middle")} @@ -143,7 +144,7 @@ export default function PointsRecharge({ title }: PointsRechargeProps) { {t("auth.agreement_sub2")} diff --git a/src/layouts/Layout/Layout.tsx b/src/layouts/Layout/Layout.tsx index f740173..53e760d 100644 --- a/src/layouts/Layout/Layout.tsx +++ b/src/layouts/Layout/Layout.tsx @@ -231,7 +231,7 @@ export function Layout({ children }: LayoutProps) { /** 角色创建页:侧栏固定收起且不可展开 */ const isCharactersCreateRoute = pathname === ROUTES.CHARACTERS_CREATE; - const shouldShowFloatingComposer = pathname !== ROUTES.SUBSCRIBE && pathname !== ROUTES.CHARACTERS_CREATE; + const shouldShowFloatingComposer = pathname !== ROUTES.SUBSCRIBE && pathname !== ROUTES.CHARACTERS_CREATE && pathname !== ROUTES.CONTENT_USER_TERMS && pathname !== ROUTES.CONTENT_PRIVACY_POLICY; const effectiveSidebarCollapsed = isCharactersCreateRoute || sidebarCollapsed; diff --git a/src/pages/content/privacy-policy/index.tsx b/src/pages/content/privacy-policy/index.tsx new file mode 100644 index 0000000..b359187 --- /dev/null +++ b/src/pages/content/privacy-policy/index.tsx @@ -0,0 +1,33 @@ +import { getPrivacyPolicy } from "@/api/api"; +import { useEffect, useState } from "react"; +import "../page/index.scss"; + +export default function PrivacyPolicy() { + const [html, setHtml] = useState(undefined); + const [title, setTitle] = useState(undefined); + + useEffect(() => { + setHtml(undefined); + getPrivacyPolicy().then((res) => { + setHtml(res.data?.content); + setTitle(res.data?.title); + }); + }, []); + + return ( +
+
+

+ {title} +

+
+
+
+
+
+ ); +} diff --git a/src/pages/content/user-terms/index.tsx b/src/pages/content/user-terms/index.tsx new file mode 100644 index 0000000..25bbede --- /dev/null +++ b/src/pages/content/user-terms/index.tsx @@ -0,0 +1,33 @@ +import { getUserTerms } from "@/api/api"; +import { useEffect, useState } from "react"; +import "../page/index.scss"; + +export default function UserTerms() { + const [html, setHtml] = useState(undefined); + const [title, setTitle] = useState(undefined); + + useEffect(() => { + setHtml(undefined); + getUserTerms().then((res) => { + setHtml(res.data?.content); + setTitle(res.data?.title); + }); + }, []); + + return ( +
+
+

+ {title} +

+
+
+
+
+
+ ); +} diff --git a/src/router/index.tsx b/src/router/index.tsx index 91888fd..89ddf6d 100644 --- a/src/router/index.tsx +++ b/src/router/index.tsx @@ -19,6 +19,8 @@ const Subscribe = lazy(() => import("@/pages/subscribe")); const Profile = lazy(() => import("@/pages/Profile")); const Legal = lazy(() => import("@/pages/legal")); const ContentPage = lazy(() => import("@/pages/content/page")); +const PrivacyPolicy = lazy(() => import("@/pages/content/privacy-policy")); +const UserTerms = lazy(() => import("@/pages/content/user-terms")); export const router = createBrowserRouter([ { @@ -75,6 +77,14 @@ export const router = createBrowserRouter([ path: "content/page", element: , }, + { + path: "content/privacy-policy", + element: , + }, + { + path: "content/user-terms", + element: , + }, ], }, { @@ -89,6 +99,14 @@ export const router = createBrowserRouter([ path: ROUTES.CONTENT, element: , }, + { + path: "/content/privacyPolicy", + element: , + }, + { + path: "/content/userTerms", + element: , + }, { path: "*", element: ,