37 lines
756 B
Vue
37 lines
756 B
Vue
<template>
|
|
<!-- <div id="nav">
|
|
<router-link to="/">Home</router-link> |
|
|
<router-link to="/about">About</router-link>
|
|
</div> -->
|
|
<router-view/>
|
|
</template>
|
|
<script lang="ts">
|
|
import { defineComponent } from 'vue';
|
|
import router from './router';
|
|
import store from './store';
|
|
import { getValue } from './utils/common';
|
|
import { provideI18n } from "@/utils/i18n"
|
|
import i18ninit from "@/i18n/init"
|
|
|
|
export default defineComponent({
|
|
setup(){
|
|
provideI18n(i18ninit);
|
|
if(getValue('token')){
|
|
store.commit("login", true)
|
|
store.dispatch("setUserInfo");
|
|
}else{
|
|
router.push("/")
|
|
}
|
|
}
|
|
})
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
.one-line-hide {
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
</style>
|