diff --git a/config/index.js b/config/index.js index f6ea675..82b8418 100644 --- a/config/index.js +++ b/config/index.js @@ -9,10 +9,21 @@ module.exports = { // Paths assetsSubDirectory: 'static', assetsPublicPath: '/', - proxyTable: {}, + // proxyTable: {}, + proxyTable: { + '/api': { + target: 'http://192.168.0.106:7080', + // target: 'http://39.101.166.211:8071/integrated_traffic_admin', + secure: true, // 如果是 https ,需要开启这个选项 + changeOrigin: true, // 是否是跨域请求?肯定是啊,不跨域就没有必要配置这个proxyTable了. + pathRewrite: { + '^/api': '' // 和下边两种写法,因人而异根据需求。 + } + } + }, // Various Dev Server settings - host: 'localhost', // can be overwritten by process.env.HOST + host: '0.0.0.0', // can be overwritten by process.env.HOST port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined autoOpenBrowser: false, errorOverlay: true, diff --git a/package.json b/package.json index 87d8c01..0922689 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "author": "", "private": true, "scripts": { - "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js --host 192.168.0.69 --open", + "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js --host 192.168.0.106 --open", "start": "npm run dev", "unit": "jest --config test/unit/jest.conf.js --coverage", "e2e": "node test/e2e/runner.js", diff --git a/src/views/classManage/classManage/components/StudentList.vue b/src/views/classManage/classManage/components/StudentList.vue index 12245a6..a2d1c89 100644 --- a/src/views/classManage/classManage/components/StudentList.vue +++ b/src/views/classManage/classManage/components/StudentList.vue @@ -129,11 +129,11 @@ - +