Selaa lähdekoodia

解决转译遗留下来的问题

Lijy 2 vuotta sitten
vanhempi
commit
91dce12d8f
1 muutettua tiedostoa jossa 15 lisäystä ja 7 poistoa
  1. 15 7
      fhKeeper/formulahousekeeper/timesheet/src/views/Home.vue

+ 15 - 7
fhKeeper/formulahousekeeper/timesheet/src/views/Home.vue

@@ -424,13 +424,21 @@
                             for(var i in msgArr) {
                                 if(msgArr[i].msg) {
                                     let caozuo = JSON.parse(JSON.stringify(msgArr[i].msg))
-                                    let textOne = caozuo.split('$userName=')[0]
-                                    let textTwo = caozuo.split('$userName=')[1].split('$')[0]
-                                    let textThree = caozuo.split('$userName=')[1].split('$')[1]
-                                    msgArr[i].omg = {
-                                        textOne: textOne,
-                                        textTwo: textTwo,
-                                        textThree: textThree
+                                    if(caozuo.indexOf('$userName=') != '-1') {
+                                        let textOne = caozuo.split('$userName=')[0]
+                                        let textTwo = caozuo.split('$userName=')[1].split('$')[0]
+                                        let textThree = caozuo.split('$userName=')[1].split('$')[1]
+                                        msgArr[i].omg = {
+                                            textOne: textOne,
+                                            textTwo: textTwo,
+                                            textThree: textThree
+                                        }
+                                    } else {
+                                        msgArr[i].omg = {
+                                            textOne: msgArr[i].msg,
+                                            textTwo: '',
+                                            textThree: ''
+                                        }
                                     }
                                 } else {
                                     msgArr[i].omg = {