11wqe1 14 hours ago
parent
commit
d4f5756a1f
1 changed files with 5 additions and 5 deletions
  1. 5 5
      src/components/studyStudent.vue

+ 5 - 5
src/components/studyStudent.vue

@@ -11689,14 +11689,14 @@
                   <div>{{ lang.ssContentColon }}</div>
                   <div>{{ lang.ssContentColon }}</div>
                   <div v-html="oldEnglishJson.engText" style="white-space: pre-line;"></div>
                   <div v-html="oldEnglishJson.engText" style="white-space: pre-line;"></div>
                 </div>
                 </div>
-                <div class="oldDetail" v-if="oldEnglishJson.imgList && oldEnglishJson.imgList.length > 0">
+                <div class="oldDetail" v-if="oldEnglishJson.imgList && oldEnglishJson.imgList.length > 0 && oldEnglishJson.imgList[0]">
                   <div>{{ lang.ssImageColon }}</div>
                   <div>{{ lang.ssImageColon }}</div>
                   <div class="oldImg"><img :src="oldEnglishJson.imgList[0].url" alt="" /></div>
                   <div class="oldImg"><img :src="oldEnglishJson.imgList[0].url" alt="" /></div>
                 </div>
                 </div>
               </div>
               </div>
             </div>
             </div>
           </div>
           </div>
-          <div class="oldBox loadingText" v-if="userMes[0].type == 2">
+          <div class="oldBox loadingText" v-if="userMes && userMes[0] && userMes[0].type == 2">
             <div class="oldMes" style="background: #aacaff;">{{ userMes[0].username }}</div>
             <div class="oldMes" style="background: #aacaff;">{{ userMes[0].username }}</div>
             <div class="oldText">
             <div class="oldText">
               <div class="detailBox" style="position: relative;">
               <div class="detailBox" style="position: relative;">
@@ -11717,7 +11717,7 @@
               </div>
               </div>
             </div>
             </div>
           </div>
           </div>
-          <div class="oldBox loadingText" v-else-if="userMes[0].type == 1">
+          <div class="oldBox loadingText" v-else-if="userMes && userMes[0] && userMes[0].type == 1">
             <div class="oldMes" style="background: rgb(224 236 255);display: flex;flex-direction: row;flex-wrap: nowrap;align-items: center;overflow-x: auto;overflow-y: hidden;" v-if="newEnglishList1.length > 0">
             <div class="oldMes" style="background: rgb(224 236 255);display: flex;flex-direction: row;flex-wrap: nowrap;align-items: center;overflow-x: auto;overflow-y: hidden;" v-if="newEnglishList1.length > 0">
               <div v-if="isNoUserid" class="allName" :style="{minWidth: `calc(100% / ${engListLength})`,background: newEngIndex == -1 ? '#aacaff' : ''}" @click="setEngText(-1)" style="background: #aacaff;">{{ userMes[0].username }}</div>
               <div v-if="isNoUserid" class="allName" :style="{minWidth: `calc(100% / ${engListLength})`,background: newEngIndex == -1 ? '#aacaff' : ''}" @click="setEngText(-1)" style="background: #aacaff;">{{ userMes[0].username }}</div>
               <div v-for="(item,index) in newEnglishList1" :key="index" class="allName" :style="{minWidth: `calc(100% / ${engListLength})`,background: index == newEngIndex ? '#aacaff' : ''}" @click="setEngText(index)">{{ item.username }}</div>
               <div v-for="(item,index) in newEnglishList1" :key="index" class="allName" :style="{minWidth: `calc(100% / ${engListLength})`,background: index == newEngIndex ? '#aacaff' : ''}" @click="setEngText(index)">{{ item.username }}</div>
@@ -12414,7 +12414,7 @@ export default {
       isPickStudent: [],
       isPickStudent: [],
       pzStype: 1,
       pzStype: 1,
       myAnList: {},
       myAnList: {},
-      userMes:{},
+      userMes:[],
       downLoading: false,
       downLoading: false,
       greyType: false,
       greyType: false,
       correctWord: [],
       correctWord: [],
@@ -20386,7 +20386,7 @@ export default {
       this.ajax
       this.ajax
         .get(this.$store.state.api + "selectUser", params)
         .get(this.$store.state.api + "selectUser", params)
         .then((res) => {
         .then((res) => {
-          this.userMes = res.data[0];
+          this.userMes = (res.data && res.data[0]) ? res.data[0] : [];
         })
         })
         .catch((err) => {
         .catch((err) => {
           console.error(err);
           console.error(err);