2023-3-27
This commit is contained in:
@@ -4,13 +4,24 @@
|
|||||||
|
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
dev: {
|
dev: {
|
||||||
|
env: require('./dev.env'),
|
||||||
// Paths
|
// Paths
|
||||||
assetsSubDirectory: 'static',
|
assetsSubDirectory: 'static',
|
||||||
assetsPublicPath: '/',
|
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
|
// Various Dev Server settings
|
||||||
host: '127.0.0.1', // can be overwritten by process.env.HOST localhost
|
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) {
|
export function exportExcel(params) {
|
||||||
return request({
|
return request({
|
||||||
|
baseURL: '/api',
|
||||||
url: '/oms/OmsOrder/exportExcel',
|
url: '/oms/OmsOrder/exportExcel',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
responseType: 'blob', // 表明返回服务器返回的数据类型
|
responseType: 'blob', // 表明返回服务器返回的数据类型
|
||||||
|
|||||||
@@ -10,6 +10,13 @@ import VCharts from 'v-charts'
|
|||||||
import '@/styles/index.scss' // global css
|
import '@/styles/index.scss' // global css
|
||||||
|
|
||||||
import App from './App'
|
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 router from './router'
|
||||||
import store from './store'
|
import store from './store'
|
||||||
// 全局自定义组件
|
// 全局自定义组件
|
||||||
|
|||||||
@@ -798,7 +798,7 @@
|
|||||||
exportExcel(this.listQuery).then((resp) => {
|
exportExcel(this.listQuery).then((resp) => {
|
||||||
// loading.close()
|
// loading.close()
|
||||||
const blob = new Blob([resp], {
|
const blob = new Blob([resp], {
|
||||||
type: 'application/vnd.ms-excel'
|
type: 'application/vnd.ms-excel;charset=utf-8'
|
||||||
})
|
})
|
||||||
const fileName = '订单列表' + '.xls'
|
const fileName = '订单列表' + '.xls'
|
||||||
const elink = document.createElement('a')
|
const elink = document.createElement('a')
|
||||||
|
|||||||
Reference in New Issue
Block a user