| | |
| | | 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('Upload') || config.url.includes('doupload') || config.url.includes('dopreload')) { |
| | | } else if (config.url.includes('doupload') || config.url.includes('dopreload')) { |
| | | config.headers = { 'Content-Type': 'multipart/form-data' } |
| | | } else if (config.method === 'post' && config.data) { |
| | | config.data = JSON.stringify(config.data) |
| | |
| | | * @description 微信业务请求 |
| | | */ |
| | | wxRequest (url, method, param) { |
| | | let _url = window.GLOB.location + ':8080/' + window.GLOB.service + url |
| | | let _url = document.location.origin + '/' + window.GLOB.service + url |
| | | if (process.env.NODE_ENV !== 'production') { |
| | | _url = document.location.origin + '/' + url |
| | | } |
| | | |
| | | if (param) { |
| | | return axios({ |
| | | url: _url, |
| | | method, |
| | | data: param |
| | | }) |
| | | } |
| | | |
| | | return axios({ |
| | | url: _url, |
| | | method |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * @description 微信业务请求 |
| | | */ |
| | | wxNginxRequest (url, method, param) { |
| | | let _url = window.GLOB.location + ':8080/' + url |
| | | if (process.env.NODE_ENV === 'production') { |
| | | _url = document.location.origin + ':8080/' + window.GLOB.service + url |
| | | _url = document.location.origin + ':8080/' + url |
| | | } |
| | | |
| | | if (param) { |
| | |
| | | method, |
| | | data: param |
| | | }) |
| | | } else { |
| | | return axios({ |
| | | url: _url, |
| | | method |
| | | }) |
| | | } |
| | | |
| | | return axios({ |
| | | url: _url, |
| | | method |
| | | }) |
| | | } |
| | | |
| | | /** |
| | |
| | | * @description 获取微信支付二维码 |
| | | */ |
| | | getWxNativePay (param) { |
| | | let _url = document.location.origin + '/' + window.GLOB.service + 'wxpay/wxNativePay' |
| | | if (process.env.NODE_ENV !== 'production') { |
| | | _url = document.location.origin + '/wxpay/wxNativePay' |
| | | } |
| | | |
| | | return axios({ |
| | | url: '/wxpay/wxNativePay', |
| | | url: _url, |
| | | method: 'post', |
| | | data: param |
| | | }) |