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
5902a07f
authored
Jan 08, 2022
by
lanyulei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加是否需要校验验证码的功能。
parent
9e60d95d
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
7 deletions
src/settings.js
src/store/getters.js
src/store/modules/settings.js
src/views/login/index.vue
src/views/system/settings/index.vue
src/settings.js
View file @
5902a07f
...
@@ -2,6 +2,7 @@ module.exports = {
...
@@ -2,6 +2,7 @@ module.exports = {
title
:
'ferry 管理平台'
,
title
:
'ferry 管理平台'
,
logo
:
'https://www.fdevops.com/wp-content/uploads/2020/08/1597815294-ferry_logo_white.png'
,
logo
:
'https://www.fdevops.com/wp-content/uploads/2020/08/1597815294-ferry_logo_white.png'
,
isLdap
:
false
,
isLdap
:
false
,
isVerifyCode
:
true
,
/**
/**
* @type {boolean} true | false
* @type {boolean} true | false
...
...
src/store/getters.js
View file @
5902a07f
...
@@ -15,6 +15,7 @@ const getters = {
...
@@ -15,6 +15,7 @@ const getters = {
errorLogs
:
state
=>
state
.
errorLog
.
logs
,
errorLogs
:
state
=>
state
.
errorLog
.
logs
,
title
:
state
=>
state
.
settings
.
title
,
title
:
state
=>
state
.
settings
.
title
,
logo
:
state
=>
state
.
settings
.
logo
,
logo
:
state
=>
state
.
settings
.
logo
,
isLdap
:
state
=>
state
.
settings
.
isLdap
isLdap
:
state
=>
state
.
settings
.
isLdap
,
isVerifyCode
:
state
=>
state
.
settings
.
isVerifyCode
}
}
export
default
getters
export
default
getters
src/store/modules/settings.js
View file @
5902a07f
...
@@ -2,7 +2,7 @@ import variables from '@/styles/element-variables.scss'
...
@@ -2,7 +2,7 @@ import variables from '@/styles/element-variables.scss'
import
defaultSettings
from
'@/settings'
import
defaultSettings
from
'@/settings'
import
{
getSettings
}
from
'@/api/system/settings'
import
{
getSettings
}
from
'@/api/system/settings'
const
{
title
,
logo
,
isLdap
,
showSettings
,
tagsView
,
fixedHeader
,
sidebarLogo
}
=
defaultSettings
const
{
title
,
logo
,
isLdap
,
showSettings
,
tagsView
,
fixedHeader
,
sidebarLogo
,
isVerifyCode
}
=
defaultSettings
const
state
=
{
const
state
=
{
theme
:
variables
.
theme
,
theme
:
variables
.
theme
,
...
@@ -12,7 +12,8 @@ const state = {
...
@@ -12,7 +12,8 @@ const state = {
sidebarLogo
:
sidebarLogo
,
sidebarLogo
:
sidebarLogo
,
title
:
title
,
title
:
title
,
logo
:
logo
,
logo
:
logo
,
isLdap
:
isLdap
isLdap
:
isLdap
,
isVerifyCode
:
isVerifyCode
}
}
const
mutations
=
{
const
mutations
=
{
...
@@ -25,6 +26,7 @@ const mutations = {
...
@@ -25,6 +26,7 @@ const mutations = {
state
.
title
=
content
.
name
state
.
title
=
content
.
name
state
.
logo
=
content
.
logo
state
.
logo
=
content
.
logo
state
.
isLdap
=
content
.
is_ldap
state
.
isLdap
=
content
.
is_ldap
state
.
isVerifyCode
=
content
.
is_verify_code
}
}
}
}
...
...
src/views/login/index.vue
View file @
5902a07f
...
@@ -68,6 +68,7 @@
...
@@ -68,6 +68,7 @@
</span>
</span>
</el-form-item>
</el-form-item>
</el-tooltip>
</el-tooltip>
<template
v-if=
"isVerifyCodeTmp"
>
<el-form-item
prop=
"code"
style=
"width: 66%;float: left; margin-bottom: 13px"
>
<el-form-item
prop=
"code"
style=
"width: 66%;float: left; margin-bottom: 13px"
>
<span
class=
"svg-container"
>
<span
class=
"svg-container"
>
<svg-icon
icon-class=
"validCode"
/>
<svg-icon
icon-class=
"validCode"
/>
...
@@ -88,6 +89,7 @@
...
@@ -88,6 +89,7 @@
<div
class=
"login-code"
style=
"cursor:pointer; width: 30%;height: 48px;float: right;background-color: #f0f1f5;"
>
<div
class=
"login-code"
style=
"cursor:pointer; width: 30%;height: 48px;float: right;background-color: #f0f1f5;"
>
<img
style=
"height: 48px;width: 100%;border: 1px solid rgba(0,0,0, 0.1);border-radius:5px;"
:src=
"codeUrl"
@
click=
"getCode"
>
<img
style=
"height: 48px;width: 100%;border: 1px solid rgba(0,0,0, 0.1);border-radius:5px;"
:src=
"codeUrl"
@
click=
"getCode"
>
</div>
</div>
</
template
>
<div
prop=
"code"
style=
"width: 100%;float: left;margin-bottom: 13px"
>
<div
prop=
"code"
style=
"width: 100%;float: left;margin-bottom: 13px"
>
<el-checkbox
v-model=
"isLdapTmp"
>
LDAP登陆
</el-checkbox>
<el-checkbox
v-model=
"isLdapTmp"
>
LDAP登陆
</el-checkbox>
</div>
</div>
...
@@ -142,7 +144,13 @@ export default {
...
@@ -142,7 +144,13 @@ export default {
}
}
},
},
computed
:
{
computed
:
{
...
mapGetters
([
'title'
,
'logo'
,
'isLdap'
])
...
mapGetters
([
'title'
,
'logo'
,
'isLdap'
,
'isVerifyCode'
]),
isVerifyCodeTmp
:
function
()
{
if
(
this
.
isVerifyCode
)
{
this
.
getCode
()
}
return
this
.
isVerifyCode
}
},
},
watch
:
{
watch
:
{
$route
:
{
$route
:
{
...
@@ -159,10 +167,16 @@ export default {
...
@@ -159,10 +167,16 @@ export default {
handler
:
function
(
val
)
{
handler
:
function
(
val
)
{
this
.
isLdapTmp
=
val
this
.
isLdapTmp
=
val
}
}
},
isVerifyCode
:
{
handler
:
function
(
val
)
{
if
(
val
)
{
this
.
getCode
()
}
}
}
}
},
},
created
()
{
created
()
{
this
.
getCode
()
// window.addEventListener('storage', this.afterQRScan)
// window.addEventListener('storage', this.afterQRScan)
this
.
getCurrentTime
()
this
.
getCurrentTime
()
},
},
...
...
src/views/system/settings/index.vue
View file @
5902a07f
...
@@ -22,7 +22,11 @@
...
@@ -22,7 +22,11 @@
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
/>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
/>
</el-upload>
</el-upload>
</el-form-item>
</el-form-item>
<el-form-item
label=
"默认LDAP登陆:"
>
<el-form-item
label=
"验证码:"
>
<el-radio
v-model=
"ruleForm.is_verify_code"
:label=
"true"
>
是
</el-radio>
<el-radio
v-model=
"ruleForm.is_verify_code"
:label=
"false"
>
否
</el-radio>
</el-form-item>
<el-form-item
label=
"LDAP登陆:"
>
<el-radio
v-model=
"ruleForm.is_ldap"
:label=
"true"
>
是
</el-radio>
<el-radio
v-model=
"ruleForm.is_ldap"
:label=
"true"
>
是
</el-radio>
<el-radio
v-model=
"ruleForm.is_ldap"
:label=
"false"
>
否
</el-radio>
<el-radio
v-model=
"ruleForm.is_ldap"
:label=
"false"
>
否
</el-radio>
</el-form-item>
</el-form-item>
...
@@ -90,7 +94,8 @@ export default {
...
@@ -90,7 +94,8 @@ export default {
ruleForm
:
{
ruleForm
:
{
name
:
''
,
name
:
''
,
logo
:
''
,
logo
:
''
,
is_ldap
:
false
is_ldap
:
false
,
is_verify_code
:
true
},
},
rules
:
{
rules
:
{
name
:
[
name
:
[
...
...
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