소스 검색

fix: 增加域名白名单

Before 7 달 전
부모
커밋
2535f5d8fc
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      src/components/Card/Card.tsx

+ 3 - 1
src/components/Card/Card.tsx

@@ -14,6 +14,8 @@ export interface CardProps {
     render?: (value: GameListRep) => ReactNode;
     groupType?: Category["bet_type"];
 }
+
+const whiteUrls = ["site-front.tiktokjakjkl.icu", "192.168.0.84"];
 const Card: FC<PropsWithChildren<CardProps>> = (props) => {
     const { render, item, groupType } = props;
 
@@ -50,7 +52,7 @@ const Card: FC<PropsWithChildren<CardProps>> = (props) => {
         };
         getGameDetailApi(params).then((res) => {
             const url =
-                window.location.host !== "site-front.tiktokjakjkl.icu"
+                whiteUrls.indexOf(window.location.hostname) !== -1
                     ? `${res.data?.game_url}&brand=${brandRef.current}`
                     : `${res.data?.game_url}&brand=${brandRef.current}&gameListIp=http://192.168.0.176:8000&gameResIp=http://192.168.0.2:8888&resServerIp=http://192.168.0.176:12580`;
             if (res.data && res.data.game_url) {