瀏覽代碼

复制链接问题

lanxin 3 周之前
父節點
當前提交
e08bc7407f

+ 5 - 8
src/components/PreviewOperate/index.tsx

@@ -7,6 +7,7 @@ import { handleCopyClick } from '@/utils/copyTxt'
 import { MessageFu } from '@/utils/message'
 import html2canvas from 'html2canvas'
 import { domShowFu } from '@/utils/domShow'
+import { baseURL } from '@/utils/http'
 
 function PreviewOperate({ src }: { src?: string }) {
   const dispatch = useDispatch()
@@ -18,7 +19,7 @@ function PreviewOperate({ src }: { src?: string }) {
 
   const copyLink = useCallback(() => {
     if (src) {
-      handleCopyClick(`https://sit-kelamayi.4dage.com/mini/#${src}`)
+      handleCopyClick(`${baseURL}/mini/#${src}`)
     } else {
       MessageFu.error('暂无数据')
     }
@@ -83,11 +84,11 @@ function PreviewOperate({ src }: { src?: string }) {
               linkElements.forEach((link: any) => {
                 if (link.href.includes('index-BNWQR98R.css')) {
                   // 替换为正确的 CSS 路径,请根据实际情况修改
-                  link.href = 'https://sit-kelamayi.4dage.com/mini/assets/index-BNWQR98R.css'
+                  link.href = `${baseURL}/mini/assets/index-BNWQR98R.css`
                 }
                 if (link.href.includes('index-DqAPdNY3.css')) {
                   // 替换为正确的 CSS 路径,请根据实际情况修改
-                  link.href = 'https://sit-kelamayi.4dage.com/mini/assets/index-DqAPdNY3.css'
+                  link.href = `${baseURL}/mini/assets/index-DqAPdNY3.css`
                 }
               })
               setIsIframeReady(true)
@@ -119,11 +120,7 @@ function PreviewOperate({ src }: { src?: string }) {
       <div className='PreviewOperateMain'>
         <div className='pageBox'>
           {src ? (
-            <iframe
-              ref={iframeRef}
-              src={`https://sit-kelamayi.4dage.com/mini/#${src}`}
-              title='preview'
-            />
+            <iframe ref={iframeRef} src={`${baseURL}/mini/#${src}`} title='preview' />
           ) : (
             <div className='noData'>暂无数据</div>
           )}

+ 3 - 2
src/pages/A4news/index.tsx

@@ -13,6 +13,7 @@ import { A4tableC } from '@/utils/tableData'
 import A4add from './A4add'
 import { handleCopyClick } from '@/utils/copyTxt'
 import { editPreview } from '@/store/action/layout'
+import { baseURL } from '@/utils/http'
 
 const pageDataBase = {
   pageNum: 1,
@@ -80,8 +81,8 @@ function A4news() {
               onClick={() =>
                 handleCopyClick(
                   item.status === 1
-                    ? `https://sit-kelamayi.4dage.com/mini/#/allDetailsShow?id=${item.informationId}&type=information&isFrom=weixin`
-                    : `https://sit-kelamayi.4dage.com/mini/#/allDetailsShow?id=${item.informationId}&type=information&preview=1&isFromPage=indexPage/news`
+                    ? `${baseURL}/mini/#/allDetailsShow?id=${item.informationId}&type=information&isFrom=weixin`
+                    : `${baseURL}/mini/#/allDetailsShow?id=${item.informationId}&type=information&preview=1&isFromPage=indexPage/news`
                 )
               }
             >

+ 3 - 2
src/pages/A5activity/index.tsx

@@ -13,6 +13,7 @@ import { A4tableC } from '@/utils/tableData'
 import A5add from './A5add'
 import { handleCopyClick } from '@/utils/copyTxt'
 import { editPreview } from '@/store/action/layout'
+import { baseURL } from '@/utils/http'
 
 const pageDataBase = {
   pageNum: 1,
@@ -80,8 +81,8 @@ function A5activity() {
               onClick={() =>
                 handleCopyClick(
                   item.status === 1
-                    ? `https://sit-kelamayi.4dage.com/mini/#/allDetailsShow?id=${item.activityId}&type=activity&isFrom=weixin`
-                    : `https://sit-kelamayi.4dage.com/mini/#/allDetailsShow?id=${item.activityId}&type=activity&preview=1&isFromPage=indexPage/activity`
+                    ? `${baseURL}/mini/#/allDetailsShow?id=${item.activityId}&type=activity&isFrom=weixin`
+                    : `${baseURL}/mini/#/allDetailsShow?id=${item.activityId}&type=activity&preview=1&isFromPage=indexPage/activity`
                 )
               }
             >

+ 3 - 2
src/pages/A6exhibition/index.tsx

@@ -13,6 +13,7 @@ import { A6tableC } from '@/utils/tableData'
 import A6add from './A6add'
 import { handleCopyClick } from '@/utils/copyTxt'
 import { editPreview } from '@/store/action/layout'
+import { baseURL } from '@/utils/http'
 
 const pageDataBase = {
   pageNum: 1,
@@ -81,8 +82,8 @@ function A6exhibition() {
               onClick={() =>
                 handleCopyClick(
                   item.status === 1
-                    ? `https://sit-kelamayi.4dage.com/mini/#/allDetailsShow?id=${item.exhibitId}&type=exhibition&isFrom=weixin`
-                    : `https://sit-kelamayi.4dage.com/mini/#/allDetailsShow?id=${item.exhibitId}&type=exhibition&preview=1&isFromPage=indexPage/exhibition`
+                    ? `${baseURL}/mini/#/allDetailsShow?id=${item.exhibitId}&type=exhibition&isFrom=weixin`
+                    : `${baseURL}/mini/#/allDetailsShow?id=${item.exhibitId}&type=exhibition&preview=1&isFromPage=indexPage/exhibition`
                 )
               }
             >

+ 3 - 2
src/pages/A7collection/index.tsx

@@ -13,6 +13,7 @@ import { A7tableC } from '@/utils/tableData'
 import A7add from './A7add'
 import { handleCopyClick } from '@/utils/copyTxt'
 import { editPreview } from '@/store/action/layout'
+import { baseURL } from '@/utils/http'
 
 const pageDataBase = {
   pageNum: 1,
@@ -81,8 +82,8 @@ function A7collection() {
               onClick={() =>
                 handleCopyClick(
                   item.status === 1
-                    ? `https://sit-kelamayi.4dage.com/mini/#/collectDetail?id=${item.artifactId}&isFrom=weixin`
-                    : `https://sit-kelamayi.4dage.com/mini/#/collectDetail?id=${item.artifactId}&preview=1`
+                    ? `${baseURL}/mini/#/collectDetail?id=${item.artifactId}&isFrom=weixin`
+                    : `${baseURL}/mini/#/collectDetail?id=${item.artifactId}&preview=1`
                 )
               }
             >

+ 7 - 4
src/store/action/Breserve.ts

@@ -1,5 +1,6 @@
 import http from '@/utils/http'
-import { AppDispatch } from '..'
+import { AppDispatch } from '../index'
+import { baseURL } from '@/utils/http'
 
 /**
  *根据Type获取预约记录列表 1-展馆预约记录 2-活动预约记录
@@ -35,13 +36,15 @@ export const B_APIdel = (id: number) => {
  * 导出Excel Type 1-展馆预约记录 2-活动预约记录
  */
 export const B_APIexportExcel = (type: number) => {
-  // return `https://sit-kelamayi.4dage.com/api/museum/appointment/exportExcel?type=${type}`
-  return http.get('museum/appointment/exportExcel?type=' + type, { responseType: 'blob' })
+  // return `baseURL/api/museum/appointment/exportExcel?type=${type}`
+  return http.get(`${baseURL}/api/museum/appointment/exportExcel?type=` + type, {
+    responseType: 'blob'
+  })
 }
 
 /**
  * 导出Excel Type 1-展馆预约记录 2-活动预约记录
  */
 // export const B_APIexportExcel = (type: number) => {
-//   return `https://sit-kelamayi.4dage.com/api/museum/appointment/exportExcel?type=${type}`
+//   return `baseURL/api/museum/appointment/exportExcel?type=${type}`
 // }

+ 4 - 3
src/store/action/D1feedback.ts

@@ -1,5 +1,6 @@
 import http from '@/utils/http'
-import { AppDispatch } from '..'
+import { AppDispatch } from '../index'
+import { baseURL } from '@/utils/http'
 /**
  *意见反馈记录-列表
  */
@@ -41,6 +42,6 @@ export const D1_APIgetInfo = (id: number) => {
  * 意见反馈记录-导出
  */
 export const D1_APIexportExcel = () => {
-  // return `https://sit-kelamayi.4dage.com/api/museum/feedback/exportExcel`
-  return http.get('museum/feedback/exportExcel', { responseType: 'blob' })
+  // return `baseURL/api/museum/feedback/exportExcel`
+  return http.get(`${baseURL}/api/museum/feedback/exportExcel`, { responseType: 'blob' })
 }