perf: 优化认证中的url检查 (#1050)

* perf: 优化认证中的url检查

* perf: 优化配置

Co-authored-by: ibuler <ibuler@qq.com>
This commit is contained in:
fit2bot
2021-09-15 20:32:17 +08:00
committed by GitHub
parent f5f4edaf63
commit d17556cdc7
3 changed files with 41 additions and 16 deletions

View File

@@ -61,6 +61,15 @@ export default {
},
AUTH_SSO: {
component: SSO
},
FORGOT_PASSWORD_URL: {
on: {
change([value], updateForm) {
if (value && !value.startsWith('http')) {
updateForm({ FORGOT_PASSWORD_URL: 'http://' + value })
}
}
}
}
},
submitMethod() {

View File

@@ -32,7 +32,7 @@ export default {
'SECURITY_COMMAND_EXECUTION',
'SECURITY_SERVICE_ACCOUNT_REGISTRATION',
'SECURITY_MAX_IDLE_TIME',
// 'SECURITY_WATERMARK_ENABLED',
'SECURITY_WATERMARK_ENABLED',
'SECURITY_SESSION_SHARE'
]
],
@@ -66,6 +66,16 @@ export default {
title: this.$t('setting.insecureCommandEmailUpdate')
}
},
LOGIN_CONFIRM_ENABLE: {
hidden: () => {
return !this.$store.getters.hasValidLicense
}
},
SECURITY_WATERMARK_ENABLED: {
hidden: () => {
return !this.$store.getters.hasValidLicense
}
},
PasswordRule: {
label: this.$t('setting.PasswordCheckRule'),
component: PasswordRule
@@ -78,12 +88,6 @@ export default {
url: '/api/v1/settings/setting/?category=security'
}
},
mounted() {
if (this.$store.getters.hasValidLicense) {
const securityWatermarkEnabled = 'SECURITY_WATERMARK_ENABLED'
this.fields[0][1].splice(3, 0, securityWatermarkEnabled)
}
},
methods: {
submitMethod() {
return 'patch'

View File

@@ -16,12 +16,19 @@ export default {
return {
fields: [
[
'KoKo', [
'KoKo',
[
'TERMINAL_PASSWORD_AUTH', 'TERMINAL_PUBLIC_KEY_AUTH',
'TERMINAL_ASSET_LIST_SORT_BY', 'TERMINAL_ASSET_LIST_PAGE_SIZE',
'TERMINAL_TELNET_REGEX'
]
],
[
'XRDP',
[
'XRDP_ENABLED', 'TERMINAL_RDP_ADDR'
]
],
[
this.$t('common.Other'),
[
@@ -32,6 +39,19 @@ export default {
fieldsMeta: {
TERMINAL_TELNET_REGEX: {
type: 'input'
},
TERMINAL_RDP_ADDR: {
hidden: () => {
return !this.$store.getters.hasValidLicense
}
},
XRDP_ENABLED: {
hidden: () => {
return !this.$store.getters.hasValidLicense
},
el: {
hiddenGroup: true
}
}
},
url: '/api/v1/settings/setting/?category=terminal',
@@ -52,14 +72,6 @@ export default {
}
},
mounted() {
if (this.$store.getters.hasValidLicense) {
const xRDPFields = [
'XRDP', [
'TERMINAL_RDP_ADDR', 'XRDP_ENABLED'
]
]
this.fields.splice(1, 0, xRDPFields)
}
},
methods: {
}