yuantianjiao 6 years ago
parent
commit
36c4f13e05
2 changed files with 11 additions and 5 deletions
  1. 10
    4
      config/index.js
  2. 1
    1
      src/router/index.js

+ 10
- 4
config/index.js View File

6
 
6
 
7
 module.exports = {
7
 module.exports = {
8
   dev: {
8
   dev: {
9
-
10
     // Paths
9
     // Paths
11
     assetsSubDirectory: 'static',
10
     assetsSubDirectory: 'static',
12
     assetsPublicPath: '/',
11
     assetsPublicPath: '/',
13
-    proxyTable: {},
14
-
12
+    proxyTable: {
13
+      '/api': {
14
+        target: 'https://dp.huiju360.com.cn/hj_operations',
15
+        // target: 'http://192.168.0.62:8080/api',
16
+        changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
17
+        pathRewrite: {
18
+          '^/api': ''
19
+        },
20
+      },
21
+    },
15
     // Various Dev Server settings
22
     // Various Dev Server settings
16
     host: '0.0.0.0', // can be overwritten by process.env.HOST
23
     host: '0.0.0.0', // can be overwritten by process.env.HOST
17
     port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
24
     port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
39
     // set this to false - it *may* help
46
     // set this to false - it *may* help
40
     // https://vue-loader.vuejs.org/en/options.html#cachebusting
47
     // https://vue-loader.vuejs.org/en/options.html#cachebusting
41
     cacheBusting: true,
48
     cacheBusting: true,
42
-
43
     cssSourceMap: true
49
     cssSourceMap: true
44
   },
50
   },
45
 
51
 

+ 1
- 1
src/router/index.js View File

8
 export default new Router({
8
 export default new Router({
9
   routes: [
9
   routes: [
10
     {
10
     {
11
-      path: '/',
11
+      path: '/test',
12
       name: 'test',
12
       name: 'test',
13
       component: test
13
       component: test
14
     }
14
     }