bonus-ui/src/App.vue

48 lines
1.1 KiB
Vue
Raw Normal View History

2024-06-26 15:11:05 +08:00
<template>
<div id="app">
<router-view />
<theme-picker />
</div>
</template>
<script>
import ThemePicker from "@/components/ThemePicker";
2024-12-09 14:10:58 +08:00
import { mapActions } from "vuex";
import { get } from "@/utils/config";
2024-12-10 14:02:08 +08:00
import { setToken } from "@/utils/auth";
2024-12-09 14:10:58 +08:00
2024-11-10 08:55:36 +08:00
// import AlertNotification from "@/views/warning/AlertNotification.vue";
2024-06-26 15:11:05 +08:00
export default {
name: "App",
components: { ThemePicker },
2024-10-29 14:19:41 +08:00
created() {
get();
2024-12-10 14:02:08 +08:00
const originHref = window.location.href;
console.log(originHref, "originHref----");
if (originHref.indexOf("token") !== -1) {
const token = originHref.split("token");
setToken(token[1].slice(1));
this.$router.push({ path: "/" });
}
2024-10-29 14:19:41 +08:00
},
2024-06-26 15:11:05 +08:00
metaInfo() {
return {
2024-12-09 14:10:58 +08:00
title:
this.$store.state.settings.dynamicTitle &&
this.$store.state.settings.title,
titleTemplate: (title) => {
return title
? `${title} - ${process.env.VUE_APP_TITLE}`
: process.env.VUE_APP_TITLE;
},
};
},
2024-06-26 15:11:05 +08:00
};
</script>
<style scoped>
#app .theme-picker {
display: none;
}
</style>