소스 검색

批量导入附件 基地址完善

shaogen1995 2 달 전
부모
커밋
45372a9f47
2개의 변경된 파일7개의 추가작업 그리고 4개의 파일을 삭제
  1. 5 2
      src/components/ZupFile/index.tsx
  2. 2 2
      src/utils/http.ts

+ 5 - 2
src/components/ZupFile/index.tsx

@@ -4,7 +4,7 @@ import { InboxOutlined } from '@ant-design/icons'
 import { MessageFu } from '@/utils/message'
 import styles from './index.module.scss'
 import { B1Xtype } from '@/pages/B_enterTibet/B1collect/data'
-import { baseURL } from '@/utils/http'
+import { baseUrlTemp, envFlag } from '@/utils/http'
 import { fileTypeRes } from '@/store/action/layout'
 import { getTokenFu } from '@/utils/storage'
 import history from '@/utils/history'
@@ -12,6 +12,9 @@ import { API_C2dels } from '@/store/action/C2files'
 import MyPopconfirm from '../MyPopconfirm'
 import { DeleteOutlined } from '@ant-design/icons'
 
+// 接口地址
+const httpUrl = envFlag ? baseUrlTemp : ''
+
 const { Dragger } = Upload
 
 type Props = {
@@ -33,7 +36,7 @@ function ZupFile({ tableList, moduleId, isShow, closeFu, succFu }: Props) {
     // 支持上传文件夹
     directory: true,
     multiple: true,
-    action: baseURL + 'cms/orderCollect/upload',
+    action: httpUrl + '/api/cms/orderCollect/upload',
     headers: {
       token: getTokenFu()
     },

+ 2 - 2
src/utils/http.ts

@@ -7,8 +7,8 @@ import { domShowFu } from './domShow'
 
 export const envFlag = process.env.NODE_ENV === 'development'
 
-// const baseUrlTemp = 'https://sit-yiwubwg.4dage.com' // 测试环境
-const baseUrlTemp = 'http://192.168.20.61:8096' // 线下环境
+// export const baseUrlTemp = 'https://sit-yiwubwg.4dage.com' // 测试环境
+export const baseUrlTemp = 'http://192.168.20.61:8096' // 线下环境
 
 const baseFlag = baseUrlTemp.includes('https://')