<template>
  <Navbar></Navbar>
  <userlist></userlist>
</template>

<script>
import Navbar from "../components/Navbar.vue";
import userlist from "../components/userlist.vue";
import axios from "axios";
import {ElNotification} from "element-plus";

export default {
  components: {Navbar,userlist},

  mounted() {
    axios.get('/api/v1/user/users').catch(function (error) {
      if (error.response.status == 400) {
        ElNotification.error({
          title: '错误',
          message: '请先登录',
          duration: 0,
        });
        window.location.href = '/login';
      }
    })
  },

}
</script>
