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 2
2
<div class =" dashboard-container" >
3
3
<div class =" dashboard-editor-container" >
4
4
<!-- <github-corner class="github-corner" /> -->
5
-
6
5
<panel-group @handleSetLineChartData =" handleSetLineChartData" />
7
-
8
6
<!-- <el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;">
9
7
<line-chart :chart-data="lineChartData" />
10
8
</el-row> -->
@@ -36,6 +34,8 @@ import LineChart from './components/LineChart'
36
34
import RadarChart from ' @/components/Echarts/RadarChart'
37
35
import PieChart from ' @/components/Echarts/PieChart'
38
36
import BarChart from ' @/components/Echarts/BarChart'
37
+ import { mapGetters } from ' vuex'
38
+ import { Message } from ' element-ui'
39
39
40
40
const lineChartData = {
41
41
newVisitis: {
@@ -67,12 +67,25 @@ export default {
67
67
PieChart,
68
68
BarChart
69
69
},
70
+ computed: {
71
+ ... mapGetters ([' roles' ])
72
+ },
70
73
data () {
71
74
return {
72
75
lineChartData: lineChartData .newVisitis
73
76
}
74
77
},
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: {
76
89
handleSetLineChartData (type ) {
77
90
this .lineChartData = lineChartData[type]
78
91
}
@@ -106,4 +119,3 @@ export default {
106
119
}
107
120
}
108
121
</style >
109
-
You can’t perform that action at this time.
0 commit comments