|
@@ -8,13 +8,14 @@ import {
|
|
|
import { CommissionModel } from "@/app/[locale]/affiliate/component/TabsCom";
|
|
|
import Table, { TableHeaderItem } from "@/components/Table";
|
|
|
import TipsModal, { ModalProps } from "@/components/TipsModal";
|
|
|
+import { usePathname } from "@/i18n/routing";
|
|
|
import { useUserInfoStore } from "@/stores/useUserInfoStore";
|
|
|
import { server } from "@/utils/client";
|
|
|
import { getToken } from "@/utils/Cookies";
|
|
|
import { copyText } from "@/utils/methods";
|
|
|
import { useRequest } from "ahooks";
|
|
|
import { Mask, Toast } from "antd-mobile";
|
|
|
-import { useLocale, useTranslations } from "next-intl";
|
|
|
+import { useTranslations } from "next-intl";
|
|
|
import Image from "next/image";
|
|
|
import { FC, useEffect, useRef, useState } from "react";
|
|
|
import "./page.scss";
|
|
@@ -164,9 +165,9 @@ const RulesClient = () => {
|
|
|
};
|
|
|
const App: FC<Props> = (props) => {
|
|
|
const t = useTranslations("SummaryPage");
|
|
|
- const locale = useLocale();
|
|
|
|
|
|
const sliderRef = useRef<HTMLDivElement>(null);
|
|
|
+ const pathname = usePathname();
|
|
|
const [num, setNum] = useState(100);
|
|
|
const [money, setMoney] = useState("5000");
|
|
|
|
|
@@ -178,8 +179,8 @@ const App: FC<Props> = (props) => {
|
|
|
const token = getToken();
|
|
|
|
|
|
// 生成分享链接
|
|
|
- const BASE_URL = globalThis.config?.NEXT_PUBLIC_SHARE_URL ?? "";
|
|
|
- const shareUrl = `${BASE_URL}/${locale}/${userInfo ? userInfo.referrer_code : "xxxxxx"}`;
|
|
|
+ const BASE_URL = window.location.href.replace(pathname, "");
|
|
|
+ const shareUrl = `${BASE_URL}/${userInfo ? userInfo.referrer_code : "xxxxxx"}`;
|
|
|
|
|
|
const url = encodeURIComponent(`${shareUrl}`);
|
|
|
const SHARE_SOURCE = [
|