From 89ee68c59cdcaa4b7fa0178be42d58bec651ee73 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 09 七月 2020 12:15:03 +0800 Subject: [PATCH] 2020-07-09 --- src/api/index.js | 41 ++++++++++++++++++++++++++++++----------- 1 files changed, 30 insertions(+), 11 deletions(-) diff --git a/src/api/index.js b/src/api/index.js index 6b34396..d2082ee 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -13,7 +13,7 @@ config.method = 'post' if (config.url.includes('LoginAndRedirect') || config.url.includes('getjsonresult')) { config.data = qs.stringify(config.data) - } else if (config.url.includes('Upload') || config.url.includes('doupload')) { + } else if (config.url.includes('Upload') || config.url.includes('doupload') || config.url.includes('dopreload')) { config.headers = { 'Content-Type': 'multipart/form-data' } } else { // config.headers.token = sessionStorage.getItem('TOKEN') || '' @@ -54,9 +54,8 @@ class Api { constructor() { - let service = window.GLOB.service ? (/\/$/.test(window.GLOB.service) ? window.GLOB.service : window.GLOB.service + '/') : '' if (process.env.NODE_ENV === 'production') { - axios.defaults.baseURL = document.location.origin + '/' + service + axios.defaults.baseURL = document.location.origin + '/' + window.GLOB.service } else { // axios.defaults.baseURL = 'http://127.0.0.1:8888' } @@ -83,7 +82,7 @@ // func: 'webapi_login', UserName: username, Password: password, - systemType: options.systemType, + systemType: options.sysType, Type: 'X' } @@ -92,8 +91,8 @@ if (isCloud) { param.debug = 'Y' - if (options.cloudLoginApi) { - param.rduri = options.cloudLoginApi + if (options.cloudServiceApi) { + param.rduri = options.cloudServiceApi.replace(/\/webapi(.*)/, '/webapi/dologon') } } else if (!isCloud && window.GLOB.mainSystemApi) { param.rduri = window.GLOB.mainSystemApi.replace(/\/webapi(.*)/, '/webapi/dologon') @@ -144,7 +143,7 @@ param.t = new Date().getTime() return axios({ - url: '/webapi/dostars', + url: `/webapi/dostars${param.func ? '/' + param.func : ''}`, data: param }) } @@ -184,7 +183,7 @@ param.t = new Date().getTime() return axios({ - url: '/webapi/dostars', + url: `/webapi/dostars${param.func ? '/' + param.func : ''}`, data: param }) } @@ -215,7 +214,7 @@ param.t = new Date().getTime() return axios({ - url: '/webapi/dostars', + url: `/webapi/dostars${param.func ? '/' + param.func : ''}`, data: param }) } @@ -269,7 +268,7 @@ return new Promise(resolve => { axios({ - url: '/webapi/dostars', + url: `/webapi/dostars${param.func ? '/' + param.func : ''}`, data: param }).then(res => { if (res.status) { @@ -313,7 +312,7 @@ param.t = new Date().getTime() return axios({ - url: '/webapi/dostars', + url: `/webapi/dostars${param.func ? '/' + param.func : ''}`, data: param }) } @@ -439,6 +438,26 @@ } /** + * @description 鏌ヨ鏂囦欢鏄惁宸蹭笂浼� + */ + getFilePreUpload (param) { + return axios({ + url: '/webapi/dopreload', + data: param + }) + } + + /** + * @description 鑾峰彇寰俊鏀粯浜岀淮鐮� + */ + getWxNativePay (param) { + return axios({ + url: '/wxpay/wxNativePay', + data: param + }) + } + + /** * @description 鏂囦欢涓婁紶 */ getFileUpload (param) { -- Gitblit v1.8.0