瀏覽代碼

url编码

zcj03 6 月之前
父節點
當前提交
8dc5ed67ed
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/hooks/useGame.tsx

+ 1 - 1
src/hooks/useGame.tsx

@@ -19,7 +19,7 @@ const useGame = () => {
             .then((res) => {
                 Toast.clear();
                 if (res.data && res.data.game_url) {
-                    const url = `${res.data?.game_url}&brand=${brand}&return_url=${process.env.NEXT_PUBLIC_SHARE_URL}`;
+                    const url = `${encodeURI(res.data.game_url)}&brand=${brand}&return_url=${process.env.NEXT_PUBLIC_SHARE_URL}`;
                     const protocol = new URL(url).protocol;
                     if (
                         whiteUrls.indexOf(window.location.hostname) !== -1 ||