Pārlūkot izejas kodu

来自自动化测试的页面跳转

洪海涛 4 gadi atpakaļ
vecāks
revīzija
afcae1747d
1 mainītis faili ar 9 papildinājumiem un 0 dzēšanām
  1. 9 0
      src/views/business/bizIdSelect.vue

+ 9 - 0
src/views/business/bizIdSelect.vue

@@ -87,6 +87,7 @@ export default {
       await settingUserSetBiz({ bizId: bizId })
     },
     enter(biz, type) {
+      const { fromPath } = this.$route.query
       if (biz.isSecret === 1 && type === 'all') {
         this.$message({
           message: '没有访问权限,请先联系系统管理员或业务线现有成员添加权限',
@@ -99,6 +100,14 @@ export default {
       this.$store.dispatch('global/setBizId', biz.code)
       this.$store.dispatch('global/setBizName', biz.name)
       this.settingUserSetBiz(biz.code)
+      // 如果是其他业务过来的,优先回到其他业务的主页面中
+      if (fromPath) {
+        const url = `${location.origin}/${fromPath}/#/env?bizId=${biz.code}`
+        // const url = `http://localhost:7101/#/env?bizId=${biz.code}`
+        // 如果是来自自动化的,
+        location.href = url
+        return
+      }
       if (!fromRoute || !fromRoute.name || fromRoute.name === 'notAccess' || fromRoute.name === 'notFound') {
         this.$router.push({ name: '项目', query: { bizId: EncryptId(biz.code) }})
         return