Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
ferry_web
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jianan
ferry_web
Commits
a009190e
Unverified
Commit
a009190e
authored
Jan 08, 2022
by
lanyulei
Committed by
GitHub
Jan 08, 2022
Browse files
Options
Browse Files
Download
Plain Diff
feat: 添加是否需要校验验证码的功能。
feat: 添加是否需要校验验证码的功能。
parents
9e60d95d
5902a07f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
50 additions
and
27 deletions
+50
-27
src/settings.js
+1
-0
src/store/getters.js
+2
-1
src/store/modules/settings.js
+4
-2
src/views/login/index.vue
+36
-22
src/views/system/settings/index.vue
+7
-2
No files found.
src/settings.js
View file @
a009190e
...
...
@@ -2,6 +2,7 @@ module.exports = {
title
:
'ferry 管理平台'
,
logo
:
'https://www.fdevops.com/wp-content/uploads/2020/08/1597815294-ferry_logo_white.png'
,
isLdap
:
false
,
isVerifyCode
:
true
,
/**
* @type {boolean} true | false
...
...
src/store/getters.js
View file @
a009190e
...
...
@@ -15,6 +15,7 @@ const getters = {
errorLogs
:
state
=>
state
.
errorLog
.
logs
,
title
:
state
=>
state
.
settings
.
title
,
logo
:
state
=>
state
.
settings
.
logo
,
isLdap
:
state
=>
state
.
settings
.
isLdap
isLdap
:
state
=>
state
.
settings
.
isLdap
,
isVerifyCode
:
state
=>
state
.
settings
.
isVerifyCode
}
export
default
getters
src/store/modules/settings.js
View file @
a009190e
...
...
@@ -2,7 +2,7 @@ import variables from '@/styles/element-variables.scss'
import
defaultSettings
from
'@/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
=
{
theme
:
variables
.
theme
,
...
...
@@ -12,7 +12,8 @@ const state = {
sidebarLogo
:
sidebarLogo
,
title
:
title
,
logo
:
logo
,
isLdap
:
isLdap
isLdap
:
isLdap
,
isVerifyCode
:
isVerifyCode
}
const
mutations
=
{
...
...
@@ -25,6 +26,7 @@ const mutations = {
state
.
title
=
content
.
name
state
.
logo
=
content
.
logo
state
.
isLdap
=
content
.
is_ldap
state
.
isVerifyCode
=
content
.
is_verify_code
}
}
...
...
src/views/login/index.vue
View file @
a009190e
...
...
@@ -68,26 +68,28 @@
</span>
</el-form-item>
</el-tooltip>
<el-form-item
prop=
"code"
style=
"width: 66%;float: left; margin-bottom: 13px"
>
<span
class=
"svg-container"
>
<svg-icon
icon-class=
"validCode"
/>
</span>
<el-input
ref=
"username"
v-model=
"loginForm.code"
placeholder=
"验证码"
name=
"username"
type=
"text"
tabindex=
"3"
maxlength=
"5"
autocomplete=
"off"
style=
" width: 75%;"
@
keyup
.
enter
.
native=
"handleLogin"
/>
</el-form-item>
<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"
>
</div>
<template
v-if=
"isVerifyCodeTmp"
>
<el-form-item
prop=
"code"
style=
"width: 66%;float: left; margin-bottom: 13px"
>
<span
class=
"svg-container"
>
<svg-icon
icon-class=
"validCode"
/>
</span>
<el-input
ref=
"username"
v-model=
"loginForm.code"
placeholder=
"验证码"
name=
"username"
type=
"text"
tabindex=
"3"
maxlength=
"5"
autocomplete=
"off"
style=
" width: 75%;"
@
keyup
.
enter
.
native=
"handleLogin"
/>
</el-form-item>
<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"
>
</div>
</
template
>
<div
prop=
"code"
style=
"width: 100%;float: left;margin-bottom: 13px"
>
<el-checkbox
v-model=
"isLdapTmp"
>
LDAP登陆
</el-checkbox>
</div>
...
...
@@ -142,7 +144,13 @@ export default {
}
},
computed
:
{
...
mapGetters
([
'title'
,
'logo'
,
'isLdap'
])
...
mapGetters
([
'title'
,
'logo'
,
'isLdap'
,
'isVerifyCode'
]),
isVerifyCodeTmp
:
function
()
{
if
(
this
.
isVerifyCode
)
{
this
.
getCode
()
}
return
this
.
isVerifyCode
}
},
watch
:
{
$route
:
{
...
...
@@ -159,10 +167,16 @@ export default {
handler
:
function
(
val
)
{
this
.
isLdapTmp
=
val
}
},
isVerifyCode
:
{
handler
:
function
(
val
)
{
if
(
val
)
{
this
.
getCode
()
}
}
}
},
created
()
{
this
.
getCode
()
// window.addEventListener('storage', this.afterQRScan)
this
.
getCurrentTime
()
},
...
...
src/views/system/settings/index.vue
View file @
a009190e
...
...
@@ -22,7 +22,11 @@
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
/>
</el-upload>
</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=
"false"
>
否
</el-radio>
</el-form-item>
...
...
@@ -90,7 +94,8 @@ export default {
ruleForm
:
{
name
:
''
,
logo
:
''
,
is_ldap
:
false
is_ldap
:
false
,
is_verify_code
:
true
},
rules
:
{
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