Commit 5902a07f by lanyulei

feat: 添加是否需要校验验证码的功能。

parent 9e60d95d
...@@ -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
......
...@@ -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
...@@ -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
} }
} }
......
...@@ -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()
}, },
......
...@@ -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: [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment