Эх сурвалжийг харах

feat: 未登录留资提示登录

zhangyuhan 8 сар өмнө
parent
commit
6ff4d86177

+ 8 - 0
apps/bigmember_pc/src/views/api-doc/index.vue

@@ -10,6 +10,7 @@ import { getAPIDocDetail } from '../../api/modules'
 import CollectInfo from '@/components/collect-info/CollectInfo.vue'
 import { throttle, forEach, uniqueId } from 'lodash'
 import { useRoute } from 'vue-router/composables'
+import { useStore } from '@/store'
 
 const route = useRoute()
 const that = getCurrentInstance().proxy
@@ -610,9 +611,16 @@ function doSelectTab(item) {
   scrollToTop(goElement, diff)
 }
 
+const isLogin = computed(() => {
+  return useStore().getters['user/loginFlag']
+})
 // 打开留资弹窗
 const collectElement = ref(null)
 function doCollect() {
+  if (!isLogin.value) {
+    that.$showLoginDialog(false, 'reload')
+    return false
+  }
   if (collectElement.value) {
     collectElement.value.moduleShow.email = false
     collectElement.value.moduleShow.agree = false