zs 7 maanden geleden
bovenliggende
commit
a7f11bb73c
1 gewijzigde bestanden met toevoegingen van 8 en 6 verwijderingen
  1. 8 6
      src/views/detail/projectDetail.vue

+ 8 - 6
src/views/detail/projectDetail.vue

@@ -194,12 +194,14 @@ const truncateString = (str, length) => {
 }
 // 查看详情
 const toView = (item, type) => {
-  if (type == '0') router.push({ path: '/achievement/detail', query: { id: item.id || item._id } })
-  else if (type == '1')
-    router.push({ path: '/project/detail', query: { id: item.id || item._id } }).then(() => {
-      // 重新刷新页面
-      location.reload()
-    })
+  if (user.value.id) {
+    if (type == '0') router.push({ path: '/achievement/detail', query: { id: item.id || item._id } })
+    else if (type == '1')
+      router.push({ path: '/project/detail', query: { id: item.id || item._id } }).then(() => {
+        // 重新刷新页面
+        location.reload()
+      })
+  } else ElMessage({ message: '未登录!', type: 'error' })
 }
 // 查看更多
 const toMore = (type) => {