소스 검색

Redirect if not admin

sbkwgh 8 년 전
부모
커밋
6c32808510
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  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>