Ver código fonte

是否展示完善个人信息弹窗

lifanagju_citu 4 meses atrás
pai
commit
38eef84c91

+ 10 - 1
src/plugins/dialogExtend/components/necessaryInfoDialog.vue

@@ -29,6 +29,7 @@ import Confirm from '@/plugins/confirm'
 import { onMounted, ref } from 'vue'
 import { getToken } from '@/utils/auth'
 import Snackbar from '@/plugins/snackbar'
+import { showImprovePersonaInfo } from '@/utils/whiteList'
 
 const props = defineProps({
   // title: String,
@@ -49,7 +50,15 @@ const props = defineProps({
 const dialog = ref(false)
 // const isMobile = ref(false)
 onMounted(() => {
-  dialog.value = true
+  const parsedUrl = new URL(window.location.href)
+  const path = parsedUrl.pathname
+  // 在白名单内不弹窗
+  if (showImprovePersonaInfo(path)) {
+    props.sure() // 如果在白名单内->不打开弹窗且继续下一步调用
+  } else {
+    dialog.value = true // 打开弹窗
+  }
+  dialog.value = path ? Boolean(!showImprovePersonaInfo(path)) : true
 })
 
 const overlay = ref(false)

+ 4 - 6
src/utils/whiteList.js

@@ -3,7 +3,6 @@
 const isInWhiteList = (url, whiteList)=> {
   const path = url.split('?')[0]
   for (const item of whiteList) {
-    debugger
     if (path.startsWith(item)) {
       return true
     }
@@ -13,14 +12,13 @@ const isInWhiteList = (url, whiteList)=> {
 
 // 是否展示完善个人信息弹窗
 export const showImprovePersonaInfo = (url) => {
-  if (!url) return
+  if (!url) return false
   const list = [
     '/recruit/entRegister',
-    '/enterpriseInvite',
     '/invite',
-    '/recruit/entRegister/joiningEnterprise',
-    '/recruit/entRegister/inReview',
+    '/enterpriseInvite',
+    // '/recruit/entRegister/joiningEnterprise',
+    // '/recruit/entRegister/inReview',
   ]
-  debugger
   return isInWhiteList(url, list)
 }