Browse Source

fix: 修改分享地址

Before 10 months ago
parent
commit
68ba320628
1 changed files with 4 additions and 9 deletions
  1. 4 9
      src/app/[locale]/affiliate/summary/page.tsx

+ 4 - 9
src/app/[locale]/affiliate/summary/page.tsx

@@ -9,11 +9,9 @@ import {
 } from "@/api/summary";
 import { useUserInfoStore } from "@/stores/useUserInfoStore";
 import { useRequest } from "ahooks";
-import { Toast } from "antd-mobile";
 import { useLocale, useTranslations } from "next-intl";
 
 import { getToken } from "@/utils/Cookies";
-import { copyText } from "@/utils/methods";
 import { FC, useRef, useState } from "react";
 import "./page.scss";
 
@@ -28,8 +26,10 @@ const App: FC<Props> = (props) => {
     const [money, setMoney] = useState("5000");
     const { userInfo } = useUserInfoStore();
     const token = getToken();
+    // 使用本地
     const BASE_URL = process.env.NEXT_PUBLIC_BASE_URL;
-    const shareUrl = `${BASE_URL}/${locale}/${userInfo ? userInfo.referrer_code : "xxxxxx"}`;
+    let newUrl = BASE_URL?.replace(/:(\d+)/, ":3000");
+    const shareUrl = `${newUrl}/${locale}/${userInfo ? userInfo.referrer_code : "xxxxxx"}`;
     const TIME = 180000;
     const [todayData, setTodayData] = useState<UserAgentToDayInfo>({
         commissar: 0,
@@ -135,11 +135,7 @@ const App: FC<Props> = (props) => {
         }
     };
 
-    const copy = (text: string) => {
-        copyText(text);
-        Toast.show({ icon: "success", content: t("copySuc"), maskClickable: false });
-    };
-
+    const copy = (text: string) => {};
     const withdrawalHandler = async () => {
         await getWithdrawalApi({ amount: 10 });
         // 间隔时间
@@ -148,7 +144,6 @@ const App: FC<Props> = (props) => {
         }, 100);
     };
 
-    // @ts-ignore
     return (
         <div className="content">
             <div className="summary referral-router-view">