Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

fix(agreements): #1219

haitao(lj)a5e9225d18cf
diff --git a/ui/src/pages/Legal/Privacy/index.tsx b/ui/src/pages/Legal/Privacy/index.tsx
index 90e0610f..2fe2fdb9 100644
--- a/ui/src/pages/Legal/Privacy/index.tsx
+++ b/ui/src/pages/Legal/Privacy/index.tsx
@@ -4,6 +4,18 @@ import { useLegalPrivacy } from '@/services';
const Index: FC = () => {
const { data: privacy } = useLegalPrivacy();
+ const contentText = privacy?.privacy_policy_original_text;
+ let matchUrl: URL | undefined;
+ try {
+ if (contentText) {
+ matchUrl = new URL(contentText);
+ }
+ // eslint-disable-next-line no-empty
+ } catch (ex) {}
+ if (matchUrl) {
+ window.location.replace(matchUrl.toString());
+ return null;
+ }
return (
<div
className="fmt fs-14"
diff --git a/ui/src/pages/Legal/Tos/index.tsx b/ui/src/pages/Legal/Tos/index.tsx
index bfd788e1..4039bfb1 100644
--- a/ui/src/pages/Legal/Tos/index.tsx
+++ b/ui/src/pages/Legal/Tos/index.tsx
@@ -4,6 +4,18 @@ import { useLegalTos } from '@/services';
const Index: FC = () => {
const { data: tos } = useLegalTos();
+ const contentText = tos?.terms_of_service_original_text;
+ let matchUrl: URL | undefined;
+ try {
+ if (contentText) {
+ matchUrl = new URL(contentText);
+ }
+ // eslint-disable-next-line no-empty
+ } catch (ex) {}
+ if (matchUrl) {
+ window.location.replace(matchUrl.toString());
+ return null;
+ }
return (
<div
className="fmt fs-14"