File tree Expand file tree Collapse file tree 3 files changed +16
-11
lines changed Expand file tree Collapse file tree 3 files changed +16
-11
lines changed Original file line number Diff line number Diff line change 5
5
< meta http-equiv ="X-UA-Compatible " content ="IE=edge ">
6
6
< meta name ="viewport " content ="width=device-width,initial-scale=1.0 ">
7
7
< link rel ="icon " href ="<%= BASE_URL %>favicon.ico ">
8
- < link rel ="stylesheet " href ="./fonts.css " />
8
+ < link rel ="stylesheet " type =" text/css " href ="./fonts.css " />
9
9
< title > OpenMTS</ title >
10
10
</ head >
11
11
< body >
Original file line number Diff line number Diff line change 1
1
<template >
2
2
<header id =" navbar" >
3
- <div id =" navbar-title" :class =" {collapsed : menuCollapsed}" >
3
+ <div id =" navbar-title" :class =" {collapsed : menuCollapsed}" @click = " navigateHome " >
4
4
<i class =" el-icon-s-home" v-if =" menuCollapsed" />
5
5
<span id =" navbar-title-text" v-else >OpenMTS</span >
6
6
</div >
@@ -55,18 +55,24 @@ export default {
55
55
},
56
56
},
57
57
methods: {
58
+ navigateHome : function () {
59
+ this .$router .push ({ path: ' /' }, () => {});
60
+ },
58
61
toggleSidebar : function () {
59
62
this .$store .commit (' toggleSidebar' );
60
63
},
61
64
userMenuAction : function (command ) {
62
65
switch (command) {
63
66
case ' account' :
64
- this .$router .push ({ name : command });
67
+ this .$router .push ({ path : ' /private/ ' + command });
65
68
break ;
66
69
case ' logout' :
67
70
this .$store .commit (' logout' );
68
71
this .$store .commit (' expandSidebar' );
69
- this .$router .push ({ path: ' /' });
72
+ this .$router .push ({ path: ' /login' }, () => {});
73
+ break ;
74
+ default :
75
+ console .error (` Invalid user menu action '${ command} ' was triggered.` );
70
76
break ;
71
77
}
72
78
},
@@ -95,6 +101,9 @@ export default {
95
101
background-color : $color-dark-accent ;
96
102
overflow : hidden ;
97
103
transition : all 0.5s ease-in-out ;
104
+ & :hover {
105
+ cursor : pointer ;
106
+ }
98
107
& .collapsed {
99
108
width : 47px ;
100
109
}
Original file line number Diff line number Diff line change @@ -14,7 +14,6 @@ import store from '../store';
14
14
const routes = [
15
15
{
16
16
path : '/' ,
17
- name : 'home' ,
18
17
beforeEnter : ( _to , _from , next ) => {
19
18
if ( store . state . token === null ) {
20
19
next ( { path : '/login' } ) ;
@@ -25,28 +24,25 @@ const routes = [
25
24
} ,
26
25
{
27
26
path : '/login' ,
28
- name : 'public' ,
29
27
component : Public ,
30
28
} ,
31
29
{
32
30
path : '/private' ,
33
- name : 'private' ,
34
31
component : Private ,
35
32
beforeEnter : function ( _to , _from , next ) {
36
33
if ( store . state . token === null ) {
37
- next ( { path : '/' } ) ;
34
+ next ( { path : '/login ' } ) ;
38
35
} else {
39
36
next ( ) ;
40
37
}
41
38
} ,
42
39
children : [
43
40
{
44
- path : '/ ' ,
41
+ path : '' ,
45
42
component : Dashboard ,
46
43
} ,
47
44
{
48
- path : '/account' ,
49
- name : 'account' ,
45
+ path : 'account' ,
50
46
component : Account ,
51
47
} ,
52
48
] ,
You can’t perform that action at this time.
0 commit comments