bonus-ui/src/App.vue

75 lines
1.8 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>
2025-11-12 15:17:33 +08:00
import ThemePicker from '@/components/ThemePicker'
import { mapActions } from 'vuex'
import { get } from '@/utils/config'
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 {
2025-11-12 15:17:33 +08:00
name: 'App',
2024-06-26 15:11:05 +08:00
components: { ThemePicker },
2024-10-29 14:19:41 +08:00
created() {
2025-11-12 15:17:33 +08:00
get()
2025-02-26 17:02:18 +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: "/" });
// }
2025-11-12 15:17:33 +08:00
const urlParams = new URLSearchParams(window.location.search)
const token = urlParams.get('token')
console.log('🚀 ~ created ~ token:', token)
2025-02-26 17:02:18 +08:00
if (token) {
2025-11-12 15:17:33 +08:00
setToken(token)
this.$router.push({ path: '/' })
2024-12-10 14:02:08 +08:00
}
2024-10-29 14:19:41 +08:00
},
2024-06-26 15:11:05 +08:00
metaInfo() {
return {
2025-11-12 15:17:33 +08:00
title: this.$store.state.settings.dynamicTitle && this.$store.state.settings.title,
2024-12-09 14:10:58 +08:00
titleTemplate: (title) => {
2025-11-12 15:17:33 +08:00
return title ? `${title} - ${process.env.VUE_APP_TITLE}` : process.env.VUE_APP_TITLE
2024-12-09 14:10:58 +08:00
},
2025-11-12 15:17:33 +08:00
}
2024-12-09 14:10:58 +08:00
},
2025-11-12 15:17:33 +08:00
}
2024-06-26 15:11:05 +08:00
</script>
2025-11-12 15:17:33 +08:00
<style scoped lang="scss">
2024-06-26 15:11:05 +08:00
#app .theme-picker {
display: none;
}
2025-11-12 15:17:33 +08:00
::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;
}
}
2024-06-26 15:11:05 +08:00
</style>