File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed
Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change 22 <div class =" dashboard-container" >
33 <div class =" dashboard-editor-container" >
44 <!-- <github-corner class="github-corner" /> -->
5-
65 <panel-group @handleSetLineChartData =" handleSetLineChartData" />
7-
86 <!-- <el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;">
97 <line-chart :chart-data="lineChartData" />
108 </el-row> -->
@@ -36,6 +34,8 @@ import LineChart from './components/LineChart'
3634import RadarChart from ' @/components/Echarts/RadarChart'
3735import PieChart from ' @/components/Echarts/PieChart'
3836import BarChart from ' @/components/Echarts/BarChart'
37+ import { mapGetters } from ' vuex'
38+ import { Message } from ' element-ui'
3939
4040const lineChartData = {
4141 newVisitis: {
@@ -67,12 +67,25 @@ export default {
6767 PieChart,
6868 BarChart
6969 },
70+ computed: {
71+ ... mapGetters ([' roles' ])
72+ },
7073 data () {
7174 return {
7275 lineChartData: lineChartData .newVisitis
7376 }
7477 },
75- methods: {
78+ // 普通用户登录后跳转到个人中心
79+ beforeRouteEnter (to , from , next ) {
80+ next (vm => {
81+ const roles = vm .$store .getters .roles ;
82+ if (roles .length > 0 && roles .includes (' 普通用户' )) {
83+ vm .$router .push (' /profile/index' );
84+ }
85+ });
86+ },
87+
88+ methods: {
7689 handleSetLineChartData (type ) {
7790 this .lineChartData = lineChartData[type]
7891 }
@@ -106,4 +119,3 @@ export default {
106119 }
107120 }
108121 </style >
109-
You can’t perform that action at this time.
0 commit comments