|  |  |  | 
|---|
|  |  |  | <img class="user-header" :src="userImg" :onerror="errorImg" /> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="user"> | 
|---|
|  |  |  | <span>{{ userName }}</span> | 
|---|
|  |  |  | <span>{{ userTrueName }}</span> | 
|---|
|  |  |  | <span id="index-date"></span> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="settings"> | 
|---|
|  |  |  | 
|---|
|  |  |  | { name: "white", color: "#fff" }, | 
|---|
|  |  |  | ]); | 
|---|
|  |  |  | const links = ref([ | 
|---|
|  |  |  | { text: "个人ä¸å¿", path: "/UserInfo", id: -1, icon: "el-icon-s-custom" }, | 
|---|
|  |  |  | // { text: "个人ä¸å¿", path: "/UserInfo", id: -1, icon: "el-icon-s-custom" }, | 
|---|
|  |  |  | { | 
|---|
|  |  |  | text: "å®å
¨éåº", | 
|---|
|  |  |  | path: "/login", | 
|---|
|  |  |  | 
|---|
|  |  |  | //2022.05.29å¢å tabé项ä¸èåèå¨åè½ | 
|---|
|  |  |  | const currentMenuId = ref(0); | 
|---|
|  |  |  | const userName = ref("--"); | 
|---|
|  |  |  | const userTrueName = ref("--"); | 
|---|
|  |  |  | const userInfo = ref({}); | 
|---|
|  |  |  | const visibleItem = reactive({ | 
|---|
|  |  |  | left: false, | 
|---|
|  |  |  | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | }; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const createSocket = (url) => { | 
|---|
|  |  |  | // å建WebSocketè¿æ¥ | 
|---|
|  |  |  | //"ws://127.0.0.1:9295/admin" | 
|---|
|  |  |  | client = new WebSocket(url); | 
|---|
|  |  |  | // const createSocket = (url) => { | 
|---|
|  |  |  | //   // å建WebSocketè¿æ¥ | 
|---|
|  |  |  | //   //"ws://127.0.0.1:9295/admin" | 
|---|
|  |  |  | //   client = new WebSocket(url); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | client.onopen = function () { | 
|---|
|  |  |  | client.onmessage = handleMessage; | 
|---|
|  |  |  | store.commit("setWebsocket", client); | 
|---|
|  |  |  | console.log("WebSocket è¿æ¥æå"); | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | //   client.onopen = function () { | 
|---|
|  |  |  | //     client.onmessage = handleMessage; | 
|---|
|  |  |  | //     store.commit("setWebsocket", client); | 
|---|
|  |  |  | //     console.log("WebSocket è¿æ¥æå"); | 
|---|
|  |  |  | //   }; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | client.onclose = function () { | 
|---|
|  |  |  | console.log("WebSocket è¿æ¥å
³é"); | 
|---|
|  |  |  | setTimeout(createSocket, 10000); | 
|---|
|  |  |  | }; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | client.onerror = function () {}; | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | //   client.onclose = function () { | 
|---|
|  |  |  | //     console.log("WebSocket è¿æ¥å
³é"); | 
|---|
|  |  |  | //     setTimeout(createSocket, 10000); | 
|---|
|  |  |  | //   }; | 
|---|
|  |  |  | //   //çå¬socketéè¯¯ä¿¡æ¯ | 
|---|
|  |  |  | //   client.onerror = function () {}; | 
|---|
|  |  |  | // }; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const changeTheme = (name) => { | 
|---|
|  |  |  | if (theme.value != name) { | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | let _userInfo = store.getters.getUserInfo(); | 
|---|
|  |  |  | if (_userInfo) { | 
|---|
|  |  |  | console.log(_userInfo); | 
|---|
|  |  |  | userName.value = _userInfo.trueNmae; | 
|---|
|  |  |  | userName.value = _userInfo.userName; | 
|---|
|  |  |  | userTrueName.value = _userInfo.userTrueName; | 
|---|
|  |  |  | if (_userInfo.img) { | 
|---|
|  |  |  | userImg.value = _config.base.getImgSrc(_userInfo.img, http.ipAddress); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | createSocket("ws://127.0.0.1:9296/" + _userInfo.userName); | 
|---|
|  |  |  | // createSocket("ws://127.0.0.1:9296/" + _userInfo.userName); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Object.assign(_config.$tabs, { open: open, close: close }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | errorImg, | 
|---|
|  |  |  | userInfo, | 
|---|
|  |  |  | userName, | 
|---|
|  |  |  | userTrueName, | 
|---|
|  |  |  | userImg, | 
|---|
|  |  |  | selectId, | 
|---|
|  |  |  | selectMenuIndex, | 
|---|