From decdc5a94a080fd164b3f9d0dc0aa0275e064d2a Mon Sep 17 00:00:00 2001 From: dqjdda <201507802@qq.com> Date: Thu, 26 Sep 2019 14:43:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=8E=AF=E5=A2=83=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E4=BB=A3=E7=90=86=E8=AE=BF=E9=97=AE=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E6=94=B9=E7=94=A8=E6=88=B7=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E4=B8=BA.xlsx?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/index.js | 30 +++++++++++++++++++++++++----- src/utils/request.js | 2 +- src/views/dashboard/PanelGroup.vue | 8 ++++---- src/views/system/user/index.vue | 2 +- 4 files changed, 31 insertions(+), 11 deletions(-) diff --git a/config/index.js b/config/index.js index f70a9d5..9307278 100644 --- a/config/index.js +++ b/config/index.js @@ -1,15 +1,35 @@ 'use strict' // Template version: 1.2.6 -// see http://vuejs-templates.github.io/webpack for documentation. - +const devEnv = require('./dev.env') +// 获取接口地址 +const base_url = devEnv.BASE_API.replace(/"/g,'') const path = require('path') - module.exports = { dev: { // Paths assetsSubDirectory: 'static', assetsPublicPath: '/', - proxyTable: {}, + // 配置代理 + proxyTable: { + '/auth': { + // 测试环境 + target: base_url, + secure: true, + changeOrigin: true, + pathRewrite: { + '^/auth': 'auth' + } + }, + '/api': { + // 测试环境 + target: base_url, + secure: true, + changeOrigin: true, + pathRewrite: { + '^/api': 'api' + } + } + }, // Various Dev Server settings host: 'localhost', // can be overwritten by process.env.HOST @@ -57,7 +77,7 @@ module.exports = { * then assetsPublicPath should be set to "/bar/". * In most cases please use '/' !!! */ - assetsPublicPath: '/', + assetsPublicPath: './', /** * Source Maps diff --git a/src/utils/request.js b/src/utils/request.js index 2cf8d2a..b37d2dd 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -7,7 +7,7 @@ import Config from '@/config' // 创建axios实例 const service = axios.create({ - baseURL: process.env.BASE_API, // api 的 base_url + baseURL: process.env.NODE_ENV === 'production' ? process.env.BASE_API : '/', // api 的 base_url timeout: Config.timeout // 请求超时时间 }) diff --git a/src/views/dashboard/PanelGroup.vue b/src/views/dashboard/PanelGroup.vue index 75765c4..d15164a 100644 --- a/src/views/dashboard/PanelGroup.vue +++ b/src/views/dashboard/PanelGroup.vue @@ -6,7 +6,7 @@
-
Daily Pv
+
日流量
@@ -17,7 +17,7 @@
-
Daily Ip
+
日IP量
@@ -28,7 +28,7 @@
-
Weekly Pv
+
周流量
@@ -39,7 +39,7 @@
-
Weekly Ip
+
周IP量
diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index 9735675..0859757 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -194,7 +194,7 @@ export default { download() { this.downloadLoading = true downloadUser().then(result => { - downloadFile(result, '用户列表', 'xls') + downloadFile(result, '用户列表', 'xlsx') this.downloadLoading = false }).catch(() => { this.downloadLoading = false