浏览代码

优化代码

zhaobao 1 年之前
父节点
当前提交
8f6a301ac8
共有 2 个文件被更改,包括 5 次插入5 次删除
  1. 1 5
      src/layout/components/Navbar.vue
  2. 4 0
      src/views/login/index.vue

+ 1 - 5
src/layout/components/Navbar.vue

@@ -124,10 +124,6 @@ export default {
     },
     initsideTab() {
       this.sideTabChange(1, this.sideMenuTabList[0])
-      const routeData = this.$router.resolve({
-        path: '/bigScreen/index'
-      })
-      window.open(routeData.href, '_blank')
     },
     toggleSideBar() {
       this.$store.dispatch('app/toggleSideBar')
@@ -150,7 +146,7 @@ export default {
       //   return
       // }
       this.sideMenuTabIndex = index
-      this.$router.replace({
+      this.$router.push({
         path: item.path
       })
       localStorage.setItem('tabIndex', index)

+ 4 - 0
src/views/login/index.vue

@@ -162,6 +162,10 @@ export default {
           this.$store.dispatch('user/login', this.loginForm).then(async(res) => {
             this.loading = false
             this.$router.push({ path: '/', query: this.otherQuery })
+            const routeData = this.$router.resolve({
+              path: '/bigScreen/index'
+            })
+            window.open(routeData.href, '_blank')
           }).catch(() => {
             this.loading = false
           })