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