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
1f4d40c0
authored
May 12, 2021
by
YuleiLan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加配置信息。
parent
82864649
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
22 deletions
src/settings.js
src/store/getters.js
src/store/modules/settings.js
src/views/login/index.vue
src/settings.js
View file @
1f4d40c0
module
.
exports
=
{
title
:
'ferry'
,
title
:
'ferry 管理平台'
,
logo
:
'https://www.fdevops.com/wp-content/uploads/2020/08/1597815294-ferry_logo_white.png'
,
isLdap
:
false
,
/**
* @type {boolean} true | false
...
...
src/store/getters.js
View file @
1f4d40c0
...
...
@@ -12,6 +12,9 @@ const getters = {
roles
:
state
=>
state
.
user
.
roles
,
permisaction
:
state
=>
state
.
user
.
permisaction
,
permission_routes
:
state
=>
state
.
permission
.
routes
,
errorLogs
:
state
=>
state
.
errorLog
.
logs
errorLogs
:
state
=>
state
.
errorLog
.
logs
,
title
:
state
=>
state
.
settings
.
title
,
logo
:
state
=>
state
.
settings
.
logo
,
isLdap
:
state
=>
state
.
settings
.
isLdap
}
export
default
getters
src/store/modules/settings.js
View file @
1f4d40c0
import
variables
from
'@/styles/element-variables.scss'
import
defaultSettings
from
'@/settings'
import
{
getSettings
}
from
'@/api/system/settings'
const
{
showSettings
,
tagsView
,
fixedHeader
,
sidebarLogo
}
=
defaultSettings
const
{
title
,
logo
,
isLdap
,
showSettings
,
tagsView
,
fixedHeader
,
sidebarLogo
}
=
defaultSettings
const
state
=
{
theme
:
variables
.
theme
,
showSettings
:
showSettings
,
tagsView
:
tagsView
,
fixedHeader
:
fixedHeader
,
sidebarLogo
:
sidebarLogo
sidebarLogo
:
sidebarLogo
,
title
:
title
,
logo
:
logo
,
isLdap
:
isLdap
}
const
mutations
=
{
...
...
@@ -16,12 +20,28 @@ const mutations = {
if
(
state
.
hasOwnProperty
(
key
))
{
state
[
key
]
=
value
}
},
CHANGE_SYSTEM_SETTING
:
(
state
,
content
)
=>
{
state
.
title
=
content
.
name
state
.
logo
=
content
.
logo
state
.
isLdap
=
content
.
is_ldap
}
}
const
actions
=
{
changeSetting
({
commit
},
data
)
{
commit
(
'CHANGE_SETTING'
,
data
)
},
// get user info
getSystemSettings
({
commit
})
{
return
new
Promise
((
resolve
)
=>
{
getSettings
({
classify
:
1
}).
then
(
response
=>
{
commit
(
'CHANGE_SYSTEM_SETTING'
,
response
.
data
[
0
].
content
)
resolve
(
response
)
})
})
}
}
...
...
src/views/login/index.vue
View file @
1f4d40c0
...
...
@@ -23,8 +23,8 @@
<div
class=
"login-weaper animated bounceInDown"
>
<div
class=
"login-left"
>
<div
class=
"login-time"
v-text=
"currentTime"
/>
<img
:src=
"
sysInfo.logo!==''?sysInfo.logo:'https://www.fdevops.com/wp-content/uploads/2020/08/1597815294-ferry_logo_white.png'
"
alt=
""
class=
"img"
>
<p
class=
"title"
v-text=
"
sysInfo.name!==''?sysInfo.name:'ferry 管理平台'
"
/>
<img
:src=
"
logo
"
alt=
""
class=
"img"
>
<p
class=
"title"
v-text=
"
title
"
/>
</div>
<div
class=
"login-border"
>
<div
class=
"login-main"
>
...
...
@@ -89,7 +89,7 @@
<img
style=
"height: 48px;width: 100%;border: 1px solid rgba(0,0,0, 0.1);border-radius:5px;"
:src=
"codeUrl"
@
click=
"getCode"
>
</div>
<div
prop=
"code"
style=
"width: 100%;float: left;margin-bottom: 13px"
>
<el-checkbox
v-model=
"
sysInfo.is_l
dap"
>
LDAP登陆
</el-checkbox>
<el-checkbox
v-model=
"
isL
dap"
>
LDAP登陆
</el-checkbox>
</div>
<el-button
:loading=
"loading"
type=
"primary"
style=
"width:100%;padding:12px 20px;margin-bottom:30px;"
@
click
.
native
.
prevent=
"handleLogin"
>
<span
v-if=
"!loading"
>
登 录
</span>
...
...
@@ -106,8 +106,8 @@
<
script
>
import
{
getCodeImg
}
from
'@/api/login'
import
{
getSettings
}
from
'@/api/system/settings'
import
moment
from
'moment'
import
{
mapGetters
}
from
'vuex'
export
default
{
name
:
'Login'
,
...
...
@@ -137,14 +137,12 @@ export default {
loading
:
false
,
redirect
:
undefined
,
otherQuery
:
{},
currentTime
:
null
,
sysInfo
:
{
logo
:
''
,
name
:
''
,
is_ldap
:
false
}
currentTime
:
null
}
},
computed
:
{
...
mapGetters
([
'title'
,
'logo'
,
'isLdap'
])
},
watch
:
{
$route
:
{
handler
:
function
(
route
)
{
...
...
@@ -161,7 +159,6 @@ export default {
this
.
getCode
()
// window.addEventListener('storage', this.afterQRScan)
this
.
getCurrentTime
()
this
.
getSystemSetting
()
},
mounted
()
{
if
(
this
.
loginForm
.
username
===
''
)
{
...
...
@@ -169,18 +166,15 @@ export default {
}
else
if
(
this
.
loginForm
.
password
===
''
)
{
this
.
$refs
.
password
.
focus
()
}
this
.
getSystemSettings
()
},
destroyed
()
{
clearInterval
(
this
.
timer
)
// window.removeEventListener('storage', this.afterQRScan)
},
methods
:
{
getSystemSetting
()
{
getSettings
({
classify
:
1
}).
then
(
response
=>
{
this
.
sysInfo
=
response
.
data
[
0
].
content
})
getSystemSettings
()
{
this
.
$store
.
dispatch
(
'settings/getSystemSettings'
)
},
getCurrentTime
()
{
this
.
timer
=
setInterval
(
_
=>
{
...
...
@@ -220,7 +214,7 @@ export default {
handleLogin
()
{
this
.
$refs
.
loginForm
.
validate
(
valid
=>
{
if
(
valid
)
{
if
(
this
.
sysInfo
.
is_l
dap
)
{
if
(
this
.
isL
dap
)
{
this
.
loginForm
.
loginType
=
1
}
else
{
this
.
loginForm
.
loginType
=
0
...
...
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