diff --git a/src/layout/index.vue b/src/layout/index.vue index 7763642a..b2a570cf 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -78,7 +78,7 @@ export default { ] }, socket: null, - wsUrl: JSON.parse(localStorage.getItem('systemConfig')).webSocketurl,//'ws://localhost:18082/ws', // WebSocket 端点 + wsUrl: '',//'ws://localhost:18082/ws', // WebSocket 端点 isConnected: false, // 连接状态 reconnectInterval: 5000 // 自动重连时间间隔(毫秒 @@ -117,6 +117,8 @@ export default { }, created() { // this.checkPasswordStatus() + const systemConfig = localStorage.getItem('systemConfig') + this.wsUrl = systemConfig ? JSON.parse(systemConfig).webSocketurl : '' if (this.roles.includes("audit") || this.roles.includes("systemAdmin")) { this.connectWebSocket(); }