Explorar el Código

feat: 系统返回按钮

zhangjie hace 7 meses
padre
commit
45021410f7

+ 43 - 30
src/assets/styles/home.scss

@@ -47,16 +47,16 @@
   display: flex;
   align-items: center;
   justify-content: flex-end;
-  background-color:#fff;
-  border-bottom:1px solid #e5e5e5;
-}
-.header-breadcrumb{
-  position:absolute;
-  top:56px;
-  left:220px;
-  height:54px;
-  padding:0 16px;
-  display:flex;
+  background-color: #fff;
+  border-bottom: 1px solid #e5e5e5;
+}
+.header-breadcrumb {
+  position: absolute;
+  top: 56px;
+  left: 220px;
+  height: 54px;
+  padding: 0 16px;
+  display: flex;
   align-items: center;
 }
 .header-menu {
@@ -105,6 +105,18 @@
     }
   }
 }
+.header-menu-back {
+  padding: 0 8px;
+  border: 1px solid #ddd;
+  border-radius: 8px;
+  line-height: 30px;
+  margin-right: 0;
+
+  &:hover {
+    color: $--color-danger;
+    border-color: $--color-danger;
+  }
+}
 
 .home-footer {
   position: absolute;
@@ -133,17 +145,16 @@
   background: #fff;
   // border-top-right-radius: 32px;
   // border-bottom-right-radius: 32px;
-
 }
 .home-logo {
   // padding: 0 40px;
   font-size: 20px;
   // line-height: 40px;
   // text-align: center;
-  height:56px;
+  height: 56px;
   a {
     display: flex;
-    height:100%;
+    height: 100%;
     padding: 0 20px;
     border-bottom: 1px solid #e5e5e5;
     align-items: center;
@@ -156,8 +167,9 @@
 }
 .el-menu-vertical-demo {
   padding-top: 20px;
-  .el-menu-item:hover, .el-menu-item:focus{
-    background-color:#F0EFFE !important;
+  .el-menu-item:hover,
+  .el-menu-item:focus {
+    background-color: #f0effe !important;
   }
   .el-submenu {
     margin-bottom: 10px;
@@ -176,26 +188,27 @@
     padding-left: 64px !important;
     height: 40px;
     line-height: 40px;
-    position:relative;
-    .menu-badge{
-      position:absolute;
-      right:10px;
-      top:10px;
-      font-size:12px;
-      color:#fff;
-      background:#F53F3F;
-      border-radius:4px;
-      padding:0 4px;
-      min-width:20px;
-      height:20px;
-      line-height:20px;
+    position: relative;
+    .menu-badge {
+      position: absolute;
+      right: 10px;
+      top: 10px;
+      font-size: 12px;
+      color: #fff;
+      background: #f53f3f;
+      border-radius: 4px;
+      padding: 0 4px;
+      min-width: 20px;
+      height: 20px;
+      line-height: 20px;
       text-align: center;
       z-index: 100;
     }
   }
-  .el-submenu .el-menu-item.is-active,.other-menus .el-menu-item.is-active {
+  .el-submenu .el-menu-item.is-active,
+  .other-menus .el-menu-item.is-active {
     font-weight: 600;
-    color:$--color-primary !important;
+    color: $--color-primary !important;
   }
   .el-submenu__icon-arrow {
     right: 40px;

+ 0 - 1
src/modules/portal/views/Login.vue

@@ -143,7 +143,6 @@ export default {
       isSubmit: false,
       dialogVisible: false,
       loginInfo: {
-        rootOrgId: "",
         domain: "",
         code: "",
         accountType: "COMMON_LOGIN_NAME",

+ 17 - 6
src/modules/portal/views/home/Home.vue

@@ -15,6 +15,15 @@
           <i class="icon icon-user"></i>{{ user.displayName }}
         </li>
         <li
+          v-if="returnUrl"
+          class="header-menu-item header-menu-back"
+          title="返回"
+          @click="logout"
+        >
+          返回<i class="el-icon-arrow-right"></i>
+        </li>
+        <li
+          v-else
           class="header-menu-item header-menu-logout"
           title="退出系统"
           @click="logout"
@@ -269,6 +278,8 @@ export default {
           ...pwdRule,
         ],
       },
+      // 第三方跳转到系统的返回地址
+      returnUrl: "",
     };
   },
   computed: {
@@ -290,6 +301,8 @@ export default {
     if (this.user.passwordWeak) {
       this.passWeakDialog = true;
     }
+
+    this.returnUrl = window.sessionStorage.getItem("returnUrl");
   },
   methods: {
     ...mapActions([USER_SIGNOUT, USER_SIGNIN]),
@@ -371,9 +384,8 @@ export default {
           this.USER_SIGNOUT();
           window.name = "";
 
-          const returnUrl = window.sessionStorage.getItem("returnUrl");
-          if (returnUrl) {
-            window.location.href = returnUrl;
+          if (this.returnUrl) {
+            window.location.href = this.returnUrl;
             return;
           }
 
@@ -392,9 +404,8 @@ export default {
           this.USER_SIGNOUT();
           window.name = "";
 
-          const returnUrl = window.sessionStorage.getItem("returnUrl");
-          if (returnUrl) {
-            window.location.href = returnUrl;
+          if (this.returnUrl) {
+            window.location.href = this.returnUrl;
             return;
           }