Переглянути джерело

Merge branch 'dev/v1.5.50_cyl' of jianyu/page_bigmember_pc into hotfix/v1.5.50.3

cuiyalong 2 роки тому
батько
коміт
9b0a76841e
1 змінених файлів з 18 додано та 19 видалено
  1. 18 19
      src/router/router-interceptors.js

+ 18 - 19
src/router/router-interceptors.js

@@ -62,26 +62,27 @@ router.beforeEach(async (to, from, next) => {
     return
   }
   if (powerCheckWhiteList.includes(to.name) || regListCheck(powerCheckPathWhiteRegList, to.path)) {
-    if (to.name === 'ent_ser_portrait') {
-      // 访问超级订阅画像,如果有权限就重定向到大会员画像
-      if (info.memberStatus > 0 && (power.indexOf(4) !== -1 || power.indexOf(13) !== -1)) {
-        if (to.query.ismedical === '1') {
-          next({
-            path: `/ent_portrait/${encodeURIComponent(to.params.eId)}?ismedical=1`,
-            replace: true
-          })
-        } else {
-          next({
-            path: `/ent_portrait/${encodeURIComponent(to.params.eId)}`,
-            replace: true
-          })
-        }
+    // 权限列表:https://app-jytest.jydev.jianyu360.com/jyapp/big-member/js/main_root_data.js
+    // 4.企业全景分析
+    // 13.企业中标动态
+    const hasEntPortPower = info.memberStatus > 0 && (power.includes(4) || power.includes(13))
+    if (hasEntPortPower) {
+      // 大会员有画像权限用户,访问超级订阅画像,则重定向到大会员画像
+      if (to.name === 'ent_ser_portrait') {
+        next({
+          path: `/ent_portrait/${encodeURIComponent(to.params.eId)}`,
+          replace: true,
+          query: {
+            // ?ismedical=1
+            ismedical: to.query.ismedical
+          }
+        })
       } else {
         next()
       }
-    } else if (to.name === 'ent_portrait') {
-      // 访问大会员画像,如果无权限就重定向到超级订阅画像
-      if (info.memberStatus < 0 || (power.indexOf(4) === -1 || power.indexOf(13) === -1)) {
+    } else {
+      if (to.name === 'ent_portrait') {
+        // 其他无画像权限用户,访问大会员画像,则重定向到超级订阅画像
         next({
           path: `/svip/ent_ser_portrait/${encodeURIComponent(to.params.eId)}`,
           replace: true
@@ -89,8 +90,6 @@ router.beforeEach(async (to, from, next) => {
       } else {
         next()
       }
-    } else {
-      next()
     }
   } else {
     let href = '/big/page/index'