ZaiZai il y a 6 mois
Parent
commit
a1fad65799
3 fichiers modifiés avec 12 ajouts et 10 suppressions
  1. 1 1
      public/version.json
  2. 4 4
      src/config/index.json
  3. 7 5
      src/layout/index.vue

+ 1 - 1
public/version.json

@@ -1,3 +1,3 @@
 {
-  "value": "20240903150326"
+  "value": "20240904113031"
 }

+ 4 - 4
src/config/index.json

@@ -1,13 +1,13 @@
 {
     "version": "20230607160059",
     "target1": "http://127.0.0.1:8090",
-    "target2": "http://192.168.0.125:8090",
-    "target": "http://39.108.216.210:8090",
+    "target": "http://192.168.0.125:8090",
+    "target3": "http://39.108.216.210:8090",
     "target4": "http://192.168.0.109:8090",
     "target5": "http://192.168.0.102:8090",
     "target6": "http://183.247.216.148:28090",
-    "socket": "wss://measure.hczcxx.cn/websocket",
-    "socket2": "ws://192.168.0.125:9527/websocket",
+    "socket1": "wss://measure.hczcxx.cn/websocket",
+    "socket": "ws://192.168.0.125:9527/websocket",
     "localModel": false,
     "smsPhone": "",
     "vite": {

+ 7 - 5
src/layout/index.vue

@@ -174,8 +174,9 @@ const cascaderSend = async ({ projectId, contractId }) => {
 }
 
 //长链接消息
+let annUpdateRef
 const annRefs = ref([])
-const annUpdateRef = ref()
+
 const socketData = async (res) => {
     console.log('socket:', res)
     const { type, data } = getObjValue(res)
@@ -185,7 +186,8 @@ const socketData = async (res) => {
         if (isNullES(data)) return
         await nextTick()
         //系统更新公告,直接替换
-        annUpdateRef.value = await HcAnnouncement({ type: 'update', data: data, time: 'xxx年xx月xx日 xx:xx:xx' })
+        //, time: 'xxx年xx月xx日 xx:xx:xx'
+        annUpdateRef = await HcAnnouncement({ type: 'update', data: data })
     } else if (type === 'msgSystemMsg') {
         //内容为空时,代表公告已经取消,由于前面已经关闭,所以不再创建
         if (isNullES(data)) {
@@ -231,9 +233,9 @@ const closeAnnFun = () => {
 
 //关闭系统更新公告
 const closeAnnUpdate = () => {
-    if (!annUpdateRef.value) {
-        annUpdateRef.value?.close()
-        annUpdateRef.value = null
+    if (!isNullES(annUpdateRef)) {
+        annUpdateRef.close()
+        annUpdateRef = null
     }
 }