Ver código fonte

报错信息

zhengnaiwen_citu 7 meses atrás
pai
commit
916f5d6105
1 arquivos alterados com 7 adições e 4 exclusões
  1. 7 4
      src/views/recruit/components/message/index.vue

+ 7 - 4
src/views/recruit/components/message/index.vue

@@ -162,7 +162,7 @@
 defineOptions({ name: 'personal-message-index'})
 import InvitePage from '@/views/recruit/enterprise/interviewManagement/components/invite'
 
-import { ref, inject, watch,onMounted, nextTick, computed } from 'vue'
+import { ref, inject, watch, nextTick, computed } from 'vue'
 import { useRoute } from 'vue-router'
 
 import Chatting from './components/chatting.vue'
@@ -285,8 +285,10 @@ if (!IM) {
 if (route.query.id) {
   const api = route.query.enterprise ? getPositionDetails : getUserInfo
   const res = await api({ id: route.query.id })
-  const query = route.query.enterprise ? [res.contact?.userId, res.contact?.enterpriseId] : [res?.id]
-  onMounted(() => {
+  if (!res) {
+    Snackbar.error('个人资料为空')
+  } else {
+    const query = route.query.enterprise ? [res.contact?.userId, res.contact?.enterpriseId] : [res?.id]
     nextTick(async () => {
       const { channel } = await checkConversation(...query)
       const items = [
@@ -299,7 +301,8 @@ if (route.query.id) {
       ]
       handleChange(items)
     })
-  })
+  }
+  
 }
 
 const {