Commit c8fcf199 authored by 以墨为白's avatar 以墨为白 🎧

websocket 访问配置话

parent 8f430b6c
...@@ -489,7 +489,7 @@ export default { ...@@ -489,7 +489,7 @@ export default {
}, },
connect() { connect() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.ws = new WebSocket(`ws://192.168.168.106:8081/websocket/my-websocket`); this.ws = new WebSocket(`ws://${window.location.host}/websocket/my-websocket`);
this.stompClient && this.stompClient.connected && this.stompClient.disconnect(); this.stompClient && this.stompClient.connected && this.stompClient.disconnect();
this.stompClient = Stomp.over(this.ws); this.stompClient = Stomp.over(this.ws);
this.stompClient.heartbeat.outgoing = 20000; //若使用STOMP 1.1 版本,默认开启了心跳检测机制(默认值都是10000ms) this.stompClient.heartbeat.outgoing = 20000; //若使用STOMP 1.1 版本,默认开启了心跳检测机制(默认值都是10000ms)
......
...@@ -27,7 +27,7 @@ module.exports = { ...@@ -27,7 +27,7 @@ module.exports = {
}), }),
new vueLoaderPlugin() new vueLoaderPlugin()
], ],
devtool:'eval', devtool: 'eval',
// devtool:'inline-source-map', // devtool:'inline-source-map',
module: { module: {
// 配置模块的读取和解析规则,通常用来配置 Loader。其类型是一个数组,数组里每一项都描述了如何去处理部分文件 // 配置模块的读取和解析规则,通常用来配置 Loader。其类型是一个数组,数组里每一项都描述了如何去处理部分文件
...@@ -42,8 +42,8 @@ module.exports = { ...@@ -42,8 +42,8 @@ module.exports = {
test: /\.js$/, test: /\.js$/,
use: [{ use: [{
loader: 'babel-loader', loader: 'babel-loader',
options:{ options: {
plugins:['syntax-dynamic-import'] plugins: ['syntax-dynamic-import']
} }
}] }]
}, },
...@@ -59,7 +59,7 @@ module.exports = { ...@@ -59,7 +59,7 @@ module.exports = {
test: /\.(eot|svg|ttf|woff|woff2|jpg|png|jpeg)$/, test: /\.(eot|svg|ttf|woff|woff2|jpg|png|jpeg)$/,
use: [{ use: [{
loader: "file-loader", loader: "file-loader",
options:{ options: {
esModule: false esModule: false
} }
}] }]
...@@ -94,6 +94,12 @@ module.exports = { ...@@ -94,6 +94,12 @@ module.exports = {
'^/api/': '/' '^/api/': '/'
} }
}, },
'/websocket/**': {
target: 'ws://192.168.168.106:8081',
ws: true,
secure: false,
logLevel: 'debug',
},
'/api_exame/': { '/api_exame/': {
target: 'http://192.168.168.110:9005', target: 'http://192.168.168.110:9005',
pathRewrite: { pathRewrite: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment