<template>
  <div id="app">
    <keep-alive>
      <router-view v-if="$route.meta.keepAlive" />
    </keep-alive>
    <router-view v-if="!$route.meta.keepAlive" />
  </div>
</template>
<script>
import { loginApp } from '../../api/index.js'
export default {
  data() {
    return {}
  },
  created() {
    this.loginApp()
  },
  methods: {
    async loginApp() {
      const res = await loginApp({
        loginName: '15620220622', //社工
        // loginName: '13525112211', //志愿
        // loginName: '13612345678', //政府
        // loginName: '13222222229', //儿童督导
        // loginName: '16601217325', // 主任
        password: '123456',
      })
      console.log(res)
      sessionStorage.setItem('userInfo', JSON.stringify(res.data))
      sessionStorage.setItem('x-token', res.data.jwtToken)
    },
  },
}
</script>
<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* text-align: center; */
  color: #333;
}
</style>
