index.vue 647 B

12345678910111213141516171819202122232425262728
  1. <template>
  2. <div>
  3. <!-- <UserProfileInfo :user='user' /> -->
  4. </div>
  5. </template>
  6. <script>
  7. export default {
  8. middleware({ store, redirect }) {
  9. if (!store.state.auth.loggedIn) {
  10. return redirect("/user/authorization");
  11. } else if (store.state.auth.user.user_permission_group == 3) {
  12. return redirect("/admin/publications");
  13. } else if (store.state.auth.user.is_allow_acess_to_admin_page === true) {
  14. window.location.href = '/admin';
  15. } else {
  16. return redirect("/user/profile");
  17. }
  18. },
  19. mounted() {
  20. console.log(this.$store.state.auth);
  21. console.log(this.$axios);
  22. },
  23. };
  24. </script>
  25. <style>
  26. </style>