fix(agreements): #1219

This commit is contained in:
haitao(lj) 2022-11-17 19:01:42 +08:00
parent cd5feed800
commit a5e9225d18
2 changed files with 24 additions and 0 deletions

View File

@ -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"

View File

@ -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"