소스 검색

用户未登录状态下操作立即沟通、立即投递及收藏职位时快速登录

lifanagju_citu 7 달 전
부모
커밋
12b02a2b14

+ 11 - 0
src/components/Enterprise/components/positions.vue

@@ -94,6 +94,16 @@ const props = defineProps({
   }
 })
 
+import { getToken } from '@/utils/auth'
+import Snackbar from '@/plugins/snackbar'
+const showLogin = ref(false)
+// 打开快速登录
+const quickLogonOpen = () => {
+  Snackbar.warning('您还未登录,请先登录后再试')
+  showLogin.value = true
+}
+
+
 const total = ref(0)
 const pageInfo = ref({
   pageSize: 10,
@@ -242,6 +252,7 @@ const desc = [
 
 // 立即沟通
 const toDetails = async (info) => {
+  if (!getToken()) return quickLogonOpen()
   const userId = info.contact.userId
   const enterpriseId = info.contact.enterpriseId
   const textObj = {

+ 10 - 0
src/components/Position/longStrip.vue

@@ -56,6 +56,7 @@ import { useI18n } from '@/hooks/web/useI18n'
 import Snackbar from '@/plugins/snackbar'
 import { getUserAvatar } from '@/utils/avatar'
 import { useRouter } from 'vue-router'
+import { ref } from 'vue'
 import { prologue, defaultText } from '@/hooks/web/useIM'
 
 const emits = defineEmits(['refresh'])
@@ -71,6 +72,14 @@ const props = defineProps({
   }
 })
 
+import { getToken } from '@/utils/auth'
+const showLogin = ref(false)
+// 打开快速登录
+const quickLogonOpen = () => {
+  Snackbar.warning('您还未登录,请先登录后再试')
+  showLogin.value = true
+}
+
 const router = useRouter()
 
 const desc = ['industryName', 'financingName', 'scaleName']
@@ -95,6 +104,7 @@ const handleToEnterprise = (item) => {
 
 // 立即沟通
 const toDetails = async (info) => {
+  if (!getToken()) return  quickLogonOpen()
   const userId = info.contact.userId
   const enterpriseId = info.contact.enterpriseId
   const textObj = {

+ 0 - 1
src/views/recruit/enterprise/search/retrieval/index.vue

@@ -152,7 +152,6 @@ const handleClear = () => {
 
 // 立即沟通
 const handleCommunicate = async (item) => {
-  debugger
   const userId = item.userId
   await talkToUser({userId, text: defaultTextEnt})
   let url = `/recruit/enterprise/chatTools?id=${userId}`

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

@@ -331,7 +331,7 @@ const shareUrl = ref('')
 const userInfo = ref(localStorage.getItem('userInfo') ? JSON.parse(localStorage.getItem('userInfo')) : {})
 const handleShare = async () => {
   // 分享链接携带参数: 用户id、职位id
-  if (!getToken()) return  quickLogonOpen()
+  if (!getToken()) return quickLogonOpen()
   generateAndDownloadImage()
   shareUrl.value = '/shareJob?' + new URLSearchParams({
     jobId: id,
@@ -342,7 +342,7 @@ const handleShare = async () => {
 
 // 收藏&取消收藏职位
 const handleCollection = async () => {
-  if (!getToken()) return  quickLogonOpen()
+  if (!getToken()) return quickLogonOpen()
   const api = isCollection.value ? getPersonJobUnfavorite : getPersonJobFavorite
   await api(isCollection.value ? id : { jobId: id })
   await getCollectionStatus()
@@ -387,7 +387,7 @@ const showResume = ref(false)
 const resumeList = ref([])
 const selectResume = ref()
 const handleDelivery = async () => {
-  if (!getToken()) return  quickLogonOpen()
+  if (!getToken()) return quickLogonOpen()
   if (delivery.value) return Snackbar.warning(t('resume.alreadyResume'))
   const result = await getPersonResumeCv()
   resumeList.value = result
@@ -422,7 +422,7 @@ const handleSubmit = async (val) =>{
 
 // 沟通
 const toDetails = async (info) => {
-  if (!getToken()) return  quickLogonOpen()
+  if (!getToken()) return quickLogonOpen()
   try {
     const userId = info.contact.userId
     const enterpriseId = info.contact.enterpriseId