2023-3-27
This commit is contained in:
@@ -4,13 +4,24 @@
|
||||
|
||||
const path = require('path')
|
||||
|
||||
|
||||
module.exports = {
|
||||
dev: {
|
||||
|
||||
env: require('./dev.env'),
|
||||
// Paths
|
||||
assetsSubDirectory: 'static',
|
||||
assetsPublicPath: '/',
|
||||
proxyTable: {},
|
||||
proxyTable: {
|
||||
'/api': { // 匹配所有以 '/api'开头的请求路径
|
||||
target: 'http://192.168.3.9:8085', // 代理目标的基础路径
|
||||
// target: 'https://260e7735j5.oicp.vip', // 代理目标的基础路径
|
||||
// target: process.env.VUE_APP_URL, // 代理目标的基础路径
|
||||
changeOrigin: true, // 支持跨域
|
||||
pathRewrite: { // 重写路径: 去掉路径中开头的'/api'
|
||||
'^/api': ''
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// Various Dev Server settings
|
||||
host: '127.0.0.1', // can be overwritten by process.env.HOST localhost
|
||||
|
||||
@@ -70,6 +70,7 @@ export function orderData(params) {
|
||||
|
||||
export function exportExcel(params) {
|
||||
return request({
|
||||
baseURL: '/api',
|
||||
url: '/oms/OmsOrder/exportExcel',
|
||||
method: 'post',
|
||||
responseType: 'blob', // 表明返回服务器返回的数据类型
|
||||
|
||||
@@ -10,6 +10,13 @@ import VCharts from 'v-charts'
|
||||
import '@/styles/index.scss' // global css
|
||||
|
||||
import App from './App'
|
||||
import Axios from 'axios'
|
||||
|
||||
Vue.prototype.$axios = Axios
|
||||
Axios.defaults.baseURL = '/api'
|
||||
Axios.defaults.headers.post['Content-Type'] = 'application/json';
|
||||
|
||||
|
||||
import router from './router'
|
||||
import store from './store'
|
||||
// 全局自定义组件
|
||||
|
||||
@@ -798,7 +798,7 @@
|
||||
exportExcel(this.listQuery).then((resp) => {
|
||||
// loading.close()
|
||||
const blob = new Blob([resp], {
|
||||
type: 'application/vnd.ms-excel'
|
||||
type: 'application/vnd.ms-excel;charset=utf-8'
|
||||
})
|
||||
const fileName = '订单列表' + '.xls'
|
||||
const elink = document.createElement('a')
|
||||
|
||||
Reference in New Issue
Block a user