Преглед изворни кода

chore(config): 更新生产环境配置和代码优化

- 将生产环境API基础URL从localhost更改为实际服务器地址
- 为Image组件添加unoptimized属性以跳过Next.js图像优化
- 修复TypeScript类型引用路径配置
- 移除调试用console.log语句
- 修改JSX转换方式为preserve模式
nahida пре 4 месеци
родитељ
комит
53ccd38668
6 измењених фајлова са 7 додато и 8 уклоњено
  1. 2 2
      .env.production
  2. 1 1
      next-env.d.ts
  3. 1 3
      src/app/news/[id]/page.tsx
  4. 0 1
      src/app/news/page.tsx
  5. 2 0
      src/components/about/ContactUs.tsx
  6. 1 1
      tsconfig.json

+ 2 - 2
.env.production

@@ -1,5 +1,5 @@
-NEXT_PUBLIC_API_BASE=http://localhost:8040
-NEXT_PUBLIC_BASE_URL=http://localhost:8040
+NEXT_PUBLIC_API_BASE=http://47.107.107.47:8040
+NEXT_PUBLIC_BASE_URL=http://47.107.107.47:8040
 NEXT_PUBLIC_REMOTE_BASE_URL=http://47.107.107.47:8040
 NEXT_PUBLIC_BASE_WS_URL = 'ws://47.107.107.47:8081/ws'
 NEXT_PUBLIC_CLIENT_URL=http://47.107.107.47:8040

+ 1 - 1
next-env.d.ts

@@ -1,6 +1,6 @@
 /// <reference types="next" />
 /// <reference types="next/image-types/global" />
-import "./.next/dev/types/routes.d.ts";
+/// <reference path="./.next/types/routes.d.ts" />
 
 // NOTE: This file should not be edited
 // see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

+ 1 - 3
src/app/news/[id]/page.tsx

@@ -59,9 +59,7 @@ async function Page({
   if (!res.data) {
     return <ContentNotFound/>
   }
-
-
-  console.log(111, res)
+  
   return (
     <>
       <div className="w-4/5 mx-auto">

+ 0 - 1
src/app/news/page.tsx

@@ -57,7 +57,6 @@ export default async function NewsPage({
   const specialNews = specialNewsRes.data.records[0]
   const newsList = newsListRes.data.records
   const totalNews = newsListRes.data.total
-  console.log(1112233,newsListRes,newsList)
   return (
     <>
       <AnimatedSection effect="slide" direction="left">

+ 2 - 0
src/components/about/ContactUs.tsx

@@ -54,6 +54,7 @@ function ContactUs({basicInfo, locationInfoList}: { basicInfo: BasicInfo, locati
             width={1000}
             height={1000}
             className="w-full h-auto block sm:hidden"
+            unoptimized
           />
           <Image
             src="/assets/about/24.jpg"
@@ -61,6 +62,7 @@ function ContactUs({basicInfo, locationInfoList}: { basicInfo: BasicInfo, locati
             width={1000}
             height={1000}
             className="w-full h-auto hidden sm:block"
+            unoptimized
           />
         </div>
         {/* <div className="grid sm:grid-cols-1 md:grid-cols-2 gap-6">

+ 1 - 1
tsconfig.json

@@ -15,7 +15,7 @@
     "moduleResolution": "bundler",
     "resolveJsonModule": true,
     "isolatedModules": true,
-    "jsx": "react-jsx",
+    "jsx": "preserve",
     "incremental": true,
     "plugins": [
       {