浏览代码

toDetails执行不成功,原因未找到

lifanagju_citu 7 月之前
父节点
当前提交
d804611b81

+ 1 - 1
src/components/Enterprise/components/positions.vue

@@ -252,8 +252,8 @@ const toDetails = async (info) => {
     showLogin.value = true // 打开快速登录弹窗
     Snackbar.warning('您还未登录,请先登录后再试')
     //
-    nextFunc.value = null // 登录成功后要执行的操作
     loginCloseWarningWord = '您已取消登录,无法对职位进行沟通' // 取消登录提示语
+    nextFunc.value = null // 登录成功后要执行的操作 (toDetails执行不成功,原因未找到)
     return
   }
   const userId = info.contact.userId

+ 1 - 1
src/components/Position/longStrip.vue

@@ -105,8 +105,8 @@ const toDetails = async (info) => {
     showLogin.value = true // 打开快速登录弹窗
     Snackbar.warning('您还未登录,请先登录后再试')
     //
-    nextFunc.value = null // 登录成功后要执行的操作
     loginCloseWarningWord = '您已取消登录,无法对职位进行沟通' // 取消登录提示语
+    nextFunc.value = null // 登录成功后要执行的操作 (toDetails执行不成功,原因未找到)
     return
   }
   const userId = info.contact.userId

+ 0 - 2
src/store/user.js

@@ -16,7 +16,6 @@ import Snackbar from '@/plugins/snackbar'
 import { timesTampChange } from '@/utils/date'
 import { updateEventList } from '@/utils/eventList'
 import { getBaseInfoDictOfName } from '@/utils/getText'
-import { useIM } from '@/hooks/web/useIM'
 // import Confirm from '@/plugins/confirm'
 
 // import { useIMStore } from './im'
@@ -59,7 +58,6 @@ export const useUserStore = defineStore('user',
             this.accountInfo = res
             localStorage.setItem('accountInfo', JSON.stringify(res))
             localStorage.setItem('expiresTime', res.expiresTime) // token过期时间
-            useIM()
             await this.getUserInfos()
             this.getUserBaseInfos()
             resolve()

+ 8 - 7
src/views/recruit/personal/position/components/details.vue

@@ -157,7 +157,7 @@
 
 <script setup>
 defineOptions({ name: 'position-details' })
-import { ref } from 'vue'
+import { nextTick, ref } from 'vue'
 import { useRouter } from 'vue-router'
 import Snackbar from '@/plugins/snackbar'
 import html2canvas from 'html2canvas'
@@ -241,7 +241,9 @@ let loginCloseWarningWord = ''
 const loginSuccess = () => {
   showLogin.value = false
   Snackbar.success('登录成功')
-  if (nextFunc.value) nextFunc.value()
+  nextTick(() => {
+    if (nextFunc.value) nextFunc.value()
+  })
   // userInfo.value = localStorage.getItem('userInfo') ? JSON.parse(localStorage.getItem('userInfo')) : {}
   // shareUrl.value = '/shareJob?' + new URLSearchParams({
   //   jobId: id,
@@ -438,18 +440,17 @@ const handleSubmit = async (val) =>{
   }, 3000)
 }
 
-let toDetailsInfo = {}
+// let toDetailsInfo = {}
 // 沟通
 const toDetails = async (info) => {
-  if (info) toDetailsInfo = info // 快速登录弹窗回调使用
-  else info = toDetailsInfo
+  // if (info) toDetailsInfo = info // 快速登录弹窗回调使用
+  // else info = toDetailsInfo
   if (!getToken()) {
     showLogin.value = true // 打开快速登录弹窗
     Snackbar.warning('您还未登录,请先登录后再试')
     //
-    nextFunc.value = null // 登录成功后要执行的操作
-    // nextFunc.value = toDetails // 登录成功后要执行的操作
     loginCloseWarningWord = '您已取消登录,无法对职位进行沟通' // 取消登录提示语
+    nextFunc.value = null // 登录成功后要执行的操作 (toDetails执行不成功,原因未找到)
     return
   }
   try {