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

websocket 访问配置话

parent 8f430b6c
......@@ -489,7 +489,7 @@ export default {
},
connect() {
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 = Stomp.over(this.ws);
this.stompClient.heartbeat.outgoing = 20000; //若使用STOMP 1.1 版本,默认开启了心跳检测机制(默认值都是10000ms)
......
......@@ -27,7 +27,7 @@ module.exports = {
}),
new vueLoaderPlugin()
],
devtool:'eval',
devtool: 'eval',
// devtool:'inline-source-map',
module: {
// 配置模块的读取和解析规则,通常用来配置 Loader。其类型是一个数组,数组里每一项都描述了如何去处理部分文件
......@@ -42,8 +42,8 @@ module.exports = {
test: /\.js$/,
use: [{
loader: 'babel-loader',
options:{
plugins:['syntax-dynamic-import']
options: {
plugins: ['syntax-dynamic-import']
}
}]
},
......@@ -59,7 +59,7 @@ module.exports = {
test: /\.(eot|svg|ttf|woff|woff2|jpg|png|jpeg)$/,
use: [{
loader: "file-loader",
options:{
options: {
esModule: false
}
}]
......@@ -94,6 +94,12 @@ module.exports = {
'^/api/': '/'
}
},
'/websocket/**': {
target: 'ws://192.168.168.106:8081',
ws: true,
secure: false,
logLevel: 'debug',
},
'/api_exame/': {
target: 'http://192.168.168.110:9005',
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