Browse Source

企业发起沟通-个人信息获取

Xiao_123 7 months ago
parent
commit
a4d3cf6723
2 changed files with 10 additions and 8 deletions
  1. 3 2
      src/hooks/web/useIM.js
  2. 7 6
      src/views/recruit/components/message/index.vue

+ 3 - 2
src/hooks/web/useIM.js

@@ -423,8 +423,9 @@ export async function prologue ({userId, enterpriseId, text}) {
 
 // 企业 to 用户
 export async function talkToUser ({userId, text}) {
-  const { channel, isNewTalk } = await checkConversation(userId)
-  if (!isNewTalk) send(text, channel)
+  const { channel } = await checkConversation(userId)
+  // if (!isNewTalk) send(text, channel)
+  send(text, channel)
 }
 
 // 检测是否存在频道

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

@@ -170,7 +170,8 @@ import { initConnect, send, initChart, getMoreMessages, checkConversation } from
 import { useI18n } from '@/hooks/web/useI18n'
 import { getPositionDetails, jobCvRelCheckSend, jobCvRelSend, jobCvRelHireSend } from '@/api/position'
 import { getInterviewInviteListByInviteUserId, getMessageType } from '@/api/common'
-import { getUserInfo } from '@/api/personal/user'
+// import { getUserInfo } from '@/api/personal/user'
+import { getBaseInfo } from '@/api/common'
 import { getJobAdvertised } from '@/api/enterprise'
 import { saveInterviewInvite } from '@/api/recruit/enterprise/interview'
 import { savePersonResumeCv } from '@/api/recruit/personal/resume'
@@ -283,19 +284,20 @@ if (!IM) {
 
 // 职位进入
 if (route.query.id) {
-  const api = route.query.enterprise ? getPositionDetails : getUserInfo
-  const res = await api({ id: route.query.id })
+  const api = route.query.enterprise ? getPositionDetails : getBaseInfo // getBaseInfo  getUserInfo
+  // const res = await api({ id: route.query.id })
+  const res = await api(route.query.enterprise ? { id: route.query.id } : { userId: route.query.id })
   if (!res) {
     Snackbar.error('个人资料为空')
   } else {
-    const query = route.query.enterprise ? [res.contact?.userId, res.contact?.enterpriseId] : [res?.id]
+    const query = route.query.enterprise ? [res.contact?.userId, res.contact?.enterpriseId] : [res?.userId]
     nextTick(async () => {
       const { channel } = await checkConversation(...query)
       const items = [
         {
           channel,
           userInfoVo: {
-            userInfoResp: route.query.enterprise ? res.contact : { ...res, userId: res.id}
+            userInfoResp: route.query.enterprise ? res.contact : { ...res, userId: res?.userId}
           }
         }
       ]
@@ -389,7 +391,6 @@ function handleChangeSendResumeStatus (status) {
 }
 
 async function handleChange (items) {
-  // console.log([...items])
   try {
     chatRef.value.changeOverlay(true)
     const { userInfoVo, channel: myChannel, unread } = items.pop()