Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Chatopera OpenSource
/
ferry_web
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
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
src/layout/components/Sidebar/Logo.vue
src/permission.js
src/utils/get-page-title.js
src/views/login/index.vue
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