From b4995fc1565b83400db692e00f5253727e53564d Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 11 八月 2022 11:26:59 +0800
Subject: [PATCH] 2022-08-11

---
 src/api/index.js |   29 ++++++++++++++++++++++++++++-
 1 files changed, 28 insertions(+), 1 deletions(-)

diff --git a/src/api/index.js b/src/api/index.js
index 1487f05..39c477c 100644
--- a/src/api/index.js
+++ b/src/api/index.js
@@ -29,7 +29,7 @@
 axios.interceptors.request.use((config) => {
   if (config.url.includes('LoginAndRedirect') || config.url.includes('getjsonresult') || config.url.includes('wxNativePay')) {
     config.data = qs.stringify(config.data)
-  } else if (config.url.includes('doupload') || config.url.includes('dopreload')) {
+  } else if (/\/doupload|\/dopreload|\/upload/.test(config.url)) {
     config.headers = { 'Content-Type': 'multipart/form-data' }
   } else if (config.method === 'post' && config.data) {
     config.data = JSON.stringify(config.data)
@@ -928,6 +928,33 @@
   }
 
   /**
+   * @description oss鏂囦欢涓婁紶
+   */
+  fileOssUpload (param) {
+    let _url = window.GLOB.location + '/file/oss/upload'
+    if (process.env.NODE_ENV === 'production') {
+      _url = document.location.origin + '/file/oss/upload'
+    }
+    if (/^http:\/\/(qingqiumarket.cn|cloud.mk9h.cn|sso.mk9h.cn)/.test(_url)) {
+      _url = window.GLOB.location + ':8080/file/oss/upload'
+      if (process.env.NODE_ENV === 'production') {
+        _url = document.location.origin + ':8080/file/oss/upload'
+      }
+    } else if (/^https:\/\/(qingqiumarket.cn|cloud.mk9h.cn|sso.mk9h.cn)/.test(_url)) {
+      _url = window.GLOB.location + ':8443/file/oss/upload'
+      if (process.env.NODE_ENV === 'production') {
+        _url = document.location.origin + ':8443/file/oss/upload'
+      }
+    }
+    
+    return axios({
+      url: _url,
+      method: 'post',
+      data: param
+    })
+  }
+
+  /**
    * @description 鑾峰彇寰俊鏀粯浜岀淮鐮�
    */
   getWxNativePay (param) {

--
Gitblit v1.8.0