yuantianjiao преди 6 години
родител
ревизия
36c4f13e05
променени са 2 файла, в които са добавени 11 реда и са изтрити 5 реда
  1. 10
    4
      config/index.js
  2. 1
    1
      src/router/index.js

+ 10
- 4
config/index.js Целия файл

@@ -6,12 +6,19 @@ const path = require('path')
6 6
 
7 7
 module.exports = {
8 8
   dev: {
9
-
10 9
     // Paths
11 10
     assetsSubDirectory: 'static',
12 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 22
     // Various Dev Server settings
16 23
     host: '0.0.0.0', // can be overwritten by process.env.HOST
17 24
     port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
@@ -39,7 +46,6 @@ module.exports = {
39 46
     // set this to false - it *may* help
40 47
     // https://vue-loader.vuejs.org/en/options.html#cachebusting
41 48
     cacheBusting: true,
42
-
43 49
     cssSourceMap: true
44 50
   },
45 51
 

+ 1
- 1
src/router/index.js Целия файл

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