bonus-ui/src/App.vue

75 lines
1.8 KiB
Vue

<template>
<div id="app">
<router-view />
<theme-picker />
</div>
</template>
<script>
import ThemePicker from '@/components/ThemePicker'
import { mapActions } from 'vuex'
import { get } from '@/utils/config'
import { setToken } from '@/utils/auth'
// import AlertNotification from "@/views/warning/AlertNotification.vue";
export default {
name: 'App',
components: { ThemePicker },
created() {
get()
// 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: "/" });
// }
const urlParams = new URLSearchParams(window.location.search)
const token = urlParams.get('token')
console.log('🚀 ~ created ~ token:', token)
if (token) {
setToken(token)
this.$router.push({ path: '/' })
}
},
metaInfo() {
return {
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
},
}
},
}
</script>
<style scoped lang="scss">
#app .theme-picker {
display: none;
}
::v-deep .el-table {
// 启用斑马纹
&.el-table--striped .el-table__body {
tr.el-table__row--striped td {
background-color: #f6fbfa !important; // 浅紫色
}
}
.el-table__header {
background: #e9f0ee;
th {
background: #e9f0ee !important;
color: #606266;
font-weight: 600;
height: 50px;
}
}
&.el-table--striped .el-table__body tr.el-table__row:hover > td.el-table__cell {
background-color: #ccf1e9 !important;
}
}
</style>