mirror of https://gitee.com/answerdev/answer.git
fix(agreements): #1219
This commit is contained in:
parent
cd5feed800
commit
a5e9225d18
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue