Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
work-order-web
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
张圳龙
work-order-web
Commits
797b6666
Commit
797b6666
authored
May 12, 2021
by
lanyulei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: 完善站点标题。
parent
036374d6
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
25 deletions
+19
-25
Logo.vue
src/layout/components/Sidebar/Logo.vue
+11
-18
permission.js
src/permission.js
+3
-1
get-page-title.js
src/utils/get-page-title.js
+5
-2
index.vue
src/views/login/index.vue
+0
-4
No files found.
src/layout/components/Sidebar/Logo.vue
View file @
797b6666
...
@@ -2,19 +2,19 @@
...
@@ -2,19 +2,19 @@
<div
class=
"sidebar-logo-container"
:class=
"
{'collapse':collapse}">
<div
class=
"sidebar-logo-container"
:class=
"
{'collapse':collapse}">
<transition
name=
"sidebarLogoFade"
>
<transition
name=
"sidebarLogoFade"
>
<router-link
v-if=
"collapse"
key=
"collapse"
class=
"sidebar-logo-link"
to=
"/"
>
<router-link
v-if=
"collapse"
key=
"collapse"
class=
"sidebar-logo-link"
to=
"/"
>
<img
v-if=
"
sysInfo.logo"
:src=
"sysInfo.
logo"
class=
"sidebar-logo"
>
<img
v-if=
"
logo"
:src=
"
logo"
class=
"sidebar-logo"
>
<h1
v-else
class=
"sidebar-title"
>
{{
sysInfo
.
nam
e
}}
</h1>
<h1
v-else
class=
"sidebar-title"
>
{{
titl
e
}}
</h1>
</router-link>
</router-link>
<router-link
v-else
key=
"expand"
class=
"sidebar-logo-link"
to=
"/"
>
<router-link
v-else
key=
"expand"
class=
"sidebar-logo-link"
to=
"/"
>
<img
v-if=
"
sysInfo.logo"
:src=
"sysInfo.
logo"
class=
"sidebar-logo"
>
<img
v-if=
"
logo"
:src=
"
logo"
class=
"sidebar-logo"
>
<h1
class=
"sidebar-title"
>
{{
sysInfo
.
nam
e
}}
</h1>
<h1
class=
"sidebar-title"
>
{{
titl
e
}}
</h1>
</router-link>
</router-link>
</transition>
</transition>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
{
getSettings
}
from
'@/api/system/settings
'
import
{
mapGetters
}
from
'vuex
'
export
default
{
export
default
{
name
:
'SidebarLogo'
,
name
:
'SidebarLogo'
,
props
:
{
props
:
{
...
@@ -23,20 +23,13 @@ export default {
...
@@ -23,20 +23,13 @@ export default {
required
:
true
required
:
true
}
}
},
},
data
()
{
computed
:
{
return
{
...
mapGetters
([
'title'
,
'logo'
,
'isLdap'
])
sysInfo
:
{
name
:
''
,
logo
:
''
}
}
},
},
created
()
{
methods
:
{
getSettings
({
getSystemSettings
()
{
classify
:
1
this
.
$store
.
dispatch
(
'settings/getSystemSettings'
)
}).
then
(
response
=>
{
}
this
.
sysInfo
=
response
.
data
[
0
].
content
})
}
}
}
}
</
script
>
</
script
>
...
...
src/permission.js
View file @
797b6666
...
@@ -8,6 +8,8 @@ import getPageTitle from '@/utils/get-page-title'
...
@@ -8,6 +8,8 @@ import getPageTitle from '@/utils/get-page-title'
NProgress
.
configure
({
showSpinner
:
false
})
// NProgress Configuration
NProgress
.
configure
({
showSpinner
:
false
})
// NProgress Configuration
store
.
dispatch
(
'settings/getSystemSettings'
)
const
whiteList
=
[
'/login'
,
'/auth-redirect'
]
// no redirect whitelist
const
whiteList
=
[
'/login'
,
'/auth-redirect'
]
// no redirect whitelist
router
.
beforeEach
(
async
(
to
,
from
,
next
)
=>
{
router
.
beforeEach
(
async
(
to
,
from
,
next
)
=>
{
...
@@ -15,7 +17,7 @@ router.beforeEach(async(to, from, next) => {
...
@@ -15,7 +17,7 @@ router.beforeEach(async(to, from, next) => {
NProgress
.
start
()
NProgress
.
start
()
// set page title
// set page title
document
.
title
=
getPageTitle
(
to
.
meta
.
title
)
document
.
title
=
getPageTitle
(
to
.
meta
.
title
,
store
.
state
.
settings
.
title
)
// determine whether the user has logged in
// determine whether the user has logged in
const
hasToken
=
getToken
()
const
hasToken
=
getToken
()
...
...
src/utils/get-page-title.js
View file @
797b6666
import
defaultSettings
from
'@/settings'
import
defaultSettings
from
'@/settings'
const
title
=
defaultSettings
.
title
||
'Vue Element Admin
'
var
title
=
defaultSettings
.
title
||
'ferry 管理平台
'
export
default
function
getPageTitle
(
pageTitle
)
{
export
default
function
getPageTitle
(
pageTitle
,
globalTitle
)
{
if
(
globalTitle
!==
undefined
&&
globalTitle
!==
null
)
{
title
=
globalTitle
}
if
(
pageTitle
)
{
if
(
pageTitle
)
{
return
`
${
pageTitle
}
-
${
title
}
`
return
`
${
pageTitle
}
-
${
title
}
`
}
}
...
...
src/views/login/index.vue
View file @
797b6666
...
@@ -166,16 +166,12 @@ export default {
...
@@ -166,16 +166,12 @@ export default {
}
else
if
(
this
.
loginForm
.
password
===
''
)
{
}
else
if
(
this
.
loginForm
.
password
===
''
)
{
this
.
$refs
.
password
.
focus
()
this
.
$refs
.
password
.
focus
()
}
}
this
.
getSystemSettings
()
},
},
destroyed
()
{
destroyed
()
{
clearInterval
(
this
.
timer
)
clearInterval
(
this
.
timer
)
// window.removeEventListener('storage', this.afterQRScan)
// window.removeEventListener('storage', this.afterQRScan)
},
},
methods
:
{
methods
:
{
getSystemSettings
()
{
this
.
$store
.
dispatch
(
'settings/getSystemSettings'
)
},
getCurrentTime
()
{
getCurrentTime
()
{
this
.
timer
=
setInterval
(
_
=>
{
this
.
timer
=
setInterval
(
_
=>
{
this
.
currentTime
=
moment
().
format
(
'YYYY-MM-DD HH时mm分ss秒'
)
this
.
currentTime
=
moment
().
format
(
'YYYY-MM-DD HH时mm分ss秒'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment