Quellcode durchsuchen

fix: update evn

Before vor 10 Monaten
Ursprung
Commit
d3d539168b

+ 1 - 1
.env.production

@@ -1 +1 @@
-NEXT_PUBLIC_BASE_URL=http://192.168.0.84:8800
+NEXT_PUBLIC_BASE_URL=http://206.168.191.126:8800

+ 1 - 0
.env.test

@@ -0,0 +1 @@
+NEXT_PUBLIC_BASE_URL=http://192.168.0.84:8800

+ 24 - 22
next.config.mjs

@@ -1,30 +1,32 @@
 /** @type {import('next').NextConfig} */
-import createNextIntlPlugin from  'next-intl/plugin';
-import path from 'path';
+import createNextIntlPlugin from "next-intl/plugin";
 const withNextIntl = createNextIntlPlugin();
 
 /** @type {import('next').NextConfig} */
 const nextConfig = {
-  output: 'standalone',
-  reactStrictMode: true,
-  transpilePackages: ['antd-mobile'],
-  sassOptions: {
-    prependData: `@import "./src/styles/variables.scss";`
-  },
-  images: {
-    remotePatterns: [
-      {
-        protocol: 'https',
-        hostname: '9f.com',
-        pathname: '/img/**',
-      },
-      {
-        protocol: 'https',
-        hostname: 'images.hibigwin.com',
-        pathname: '/9f/**',
-      },
-    ],
-  },
+    output: "standalone",
+    reactStrictMode: true,
+    env: {
+        BUILD_ENV: process.env.BUILD_ENV,
+    },
+    transpilePackages: ["antd-mobile"],
+    sassOptions: {
+        prependData: `@import "./src/styles/variables.scss";`,
+    },
+    images: {
+        remotePatterns: [
+            {
+                protocol: "https",
+                hostname: "9f.com",
+                pathname: "/img/**",
+            },
+            {
+                protocol: "https",
+                hostname: "images.hibigwin.com",
+                pathname: "/9f/**",
+            },
+        ],
+    },
 };
 
 export default withNextIntl(nextConfig);

+ 12 - 3
package.json

@@ -3,9 +3,17 @@
   "version": "0.1.0",
   "private": true,
   "scripts": {
-    "dev": "next dev",
-    "build": "next build",
-    "start": "next start",
+    "dev": "cross-env NODE_ENV=development next dev",
+
+    "dev:test": "cross-env NODE_ENV=test  next dev",
+    "build:test":"cross-env NODE_ENV=test  next build",
+    "start:test": "cross-env NODE_ENV=test next start",
+
+    "build": "cross-env NODE_ENV=production next build",
+    "start": "cross-env NODE_ENV=production next start",
+
+
+
     "lint": "next lint",
     "preinstall": "npx only-allow pnpm"
   },
@@ -35,6 +43,7 @@
     "@types/react": "^18.3.3",
     "@types/react-dom": "^18.3.0",
     "@types/webpack-env": "^1.18.5",
+    "cross-env": "^7.0.3",
     "eslint": "^8.57.0",
     "eslint-config-next": "14.2.4",
     "eslint-config-prettier": "^9.1.0",

+ 15 - 3
pnpm-lock.yaml

@@ -78,6 +78,9 @@ importers:
       '@types/webpack-env':
         specifier: ^1.18.5
         version: 1.18.5
+      cross-env:
+        specifier: ^7.0.3
+        version: 7.0.3
       eslint:
         specifier: ^8.57.0
         version: 8.57.0
@@ -1517,6 +1520,11 @@ packages:
   concat-map@0.0.1:
     resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==}
 
+  cross-env@7.0.3:
+    resolution: {integrity: sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==}
+    engines: {node: '>=10.14', npm: '>=6', yarn: '>=1'}
+    hasBin: true
+
   cross-spawn@7.0.3:
     resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==}
     engines: {node: '>= 8'}
@@ -5266,6 +5274,10 @@ snapshots:
 
   concat-map@0.0.1: {}
 
+  cross-env@7.0.3:
+    dependencies:
+      cross-spawn: 7.0.3
+
   cross-spawn@7.0.3:
     dependencies:
       path-key: 3.1.1
@@ -5488,7 +5500,7 @@ snapshots:
       eslint: 8.57.0
       eslint-import-resolver-node: 0.3.9
       eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0)
-      eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0)
+      eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0)
       eslint-plugin-jsx-a11y: 6.9.0(eslint@8.57.0)
       eslint-plugin-react: 7.34.4(eslint@8.57.0)
       eslint-plugin-react-hooks: 4.6.2(eslint@8.57.0)
@@ -5516,7 +5528,7 @@ snapshots:
       enhanced-resolve: 5.17.0
       eslint: 8.57.0
       eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0)
-      eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0)
+      eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0)
       fast-glob: 3.3.2
       get-tsconfig: 4.7.5
       is-core-module: 2.14.0
@@ -5538,7 +5550,7 @@ snapshots:
     transitivePeerDependencies:
       - supports-color
 
-  eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0):
+  eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.3))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0):
     dependencies:
       array-includes: 3.1.8
       array.prototype.findlastindex: 1.2.5

+ 2 - 1
src/app/[locale]/affiliate/summary/page.tsx

@@ -28,7 +28,8 @@ const App: FC<Props> = (props) => {
     const [money, setMoney] = useState("5000");
     const { userInfo } = useUserInfoStore();
     const token = getToken();
-    const shareUrl = `http://192.168.0.84:3000/${locale}/${userInfo ? userInfo.referrer_code : "xxxxxx"}`;
+    const BASE_URL = process.env.NEXT_PUBLIC_BASE_URL;
+    const shareUrl = `${BASE_URL}/${locale}/${userInfo ? userInfo.referrer_code : "xxxxxx"}`;
     const TIME = 180000;
     const [todayData, setTodayData] = useState<UserAgentToDayInfo>({
         commissar: 0,

+ 6 - 2
src/components/Card/Card.tsx

@@ -55,7 +55,11 @@ const Card: FC<PropsWithChildren<CardProps>> = (props) => {
                 render(item!)
             ) : (
                 <div className={styles.cardWrap} onClick={() => handler(item!)}>
-                    <img src={item?.game_icon} alt={item?.game_name_cn} className={"h-[100%]"} />
+                    <img
+                        src={item?.game_icon}
+                        alt={item?.game_name_cn}
+                        className={"h-[100%] w-[100%]"}
+                    />
                 </div>
             )}
 
@@ -76,7 +80,7 @@ const Card: FC<PropsWithChildren<CardProps>> = (props) => {
                         <img
                             src={item?.game_icon}
                             alt={item?.game_name_cn}
-                            className={"h-[100%]"}
+                            className={"h-[100%] w-[100%]"}
                         />
                     </div>
                     <div className={styles.cardWrapGmeInfo}>

+ 1 - 0
src/utils/client/index.ts

@@ -5,6 +5,7 @@ import Request from "./axios";
 
 const BASE_URL = process.env.NEXT_PUBLIC_BASE_URL;
 
+console.log(`🚀🚀🚀🚀🚀-> in index.ts on 8`, process.env.NODE_ENV);
 const server = new Request({
     timeout: 10 * 1000,
     baseURL: BASE_URL,