Procházet zdrojové kódy

Redirect if not admin

sbkwgh před 8 roky
rodič
revize
6c32808510
1 změnil soubory, kde provedl 6 přidání a 0 odebrání
  1. 6 0
      src/components/routes/Admin.vue

+ 6 - 0
src/components/routes/Admin.vue

@@ -45,6 +45,12 @@
 		},
 		created () {
 			this.selected = this.$route.path.split('/')[2]
+
+			if(!this.$store.state.admin) {
+				this.$router.push('/')
+				this.$store.commit('setAccountTabs', 1)
+				this.$store.commit('setAccountModalState', true)
+			}
 		}
 	}
 </script>