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
Hide 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 @@
<div
class=
"sidebar-logo-container"
:class=
"
{'collapse':collapse}">
<transition
name=
"sidebarLogoFade"
>
<router-link
v-if=
"collapse"
key=
"collapse"
class=
"sidebar-logo-link"
to=
"/"
>
<img
v-if=
"
sysInfo.logo"
:src=
"sysInfo.
logo"
class=
"sidebar-logo"
>
<h1
v-else
class=
"sidebar-title"
>
{{
sysInfo
.
nam
e
}}
</h1>
<img
v-if=
"
logo"
:src=
"
logo"
class=
"sidebar-logo"
>
<h1
v-else
class=
"sidebar-title"
>
{{
titl
e
}}
</h1>
</router-link>
<router-link
v-else
key=
"expand"
class=
"sidebar-logo-link"
to=
"/"
>
<img
v-if=
"
sysInfo.logo"
:src=
"sysInfo.
logo"
class=
"sidebar-logo"
>
<h1
class=
"sidebar-title"
>
{{
sysInfo
.
nam
e
}}
</h1>
<img
v-if=
"
logo"
:src=
"
logo"
class=
"sidebar-logo"
>
<h1
class=
"sidebar-title"
>
{{
titl
e
}}
</h1>
</router-link>
</transition>
</div>
</
template
>
<
script
>
import
{
getSettings
}
from
'@/api/system/settings
'
import
{
mapGetters
}
from
'vuex
'
export
default
{
name
:
'SidebarLogo'
,
props
:
{
...
...
@@ -23,20 +23,13 @@ export default {
required
:
true
}
},
data
()
{
return
{
sysInfo
:
{
name
:
''
,
logo
:
''
}
}
computed
:
{
...
mapGetters
([
'title'
,
'logo'
,
'isLdap'
])
},
created
()
{
getSettings
({
classify
:
1
}).
then
(
response
=>
{
this
.
sysInfo
=
response
.
data
[
0
].
content
})
methods
:
{
getSystemSettings
()
{
this
.
$store
.
dispatch
(
'settings/getSystemSettings'
)
}
}
}
</
script
>
...
...
src/permission.js
View file @
797b6666
...
...
@@ -8,6 +8,8 @@ import getPageTitle from '@/utils/get-page-title'
NProgress
.
configure
({
showSpinner
:
false
})
// NProgress Configuration
store
.
dispatch
(
'settings/getSystemSettings'
)
const
whiteList
=
[
'/login'
,
'/auth-redirect'
]
// no redirect whitelist
router
.
beforeEach
(
async
(
to
,
from
,
next
)
=>
{
...
...
@@ -15,7 +17,7 @@ router.beforeEach(async(to, from, next) => {
NProgress
.
start
()
// 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
const
hasToken
=
getToken
()
...
...
src/utils/get-page-title.js
View file @
797b6666
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
)
{
return
`
${
pageTitle
}
-
${
title
}
`
}
...
...
src/views/login/index.vue
View file @
797b6666
...
...
@@ -166,16 +166,12 @@ export default {
}
else
if
(
this
.
loginForm
.
password
===
''
)
{
this
.
$refs
.
password
.
focus
()
}
this
.
getSystemSettings
()
},
destroyed
()
{
clearInterval
(
this
.
timer
)
// window.removeEventListener('storage', this.afterQRScan)
},
methods
:
{
getSystemSettings
()
{
this
.
$store
.
dispatch
(
'settings/getSystemSettings'
)
},
getCurrentTime
()
{
this
.
timer
=
setInterval
(
_
=>
{
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