mirror of
https://github.com/jumpserver/lina.git
synced 2026-01-29 21:28:52 +00:00
fix(settings): 修复ldap提交时,json报错 (#836)
* perf: 修改命令存储创建 * fix(settings): 修复ldap提交时,json报错 Co-authored-by: ibuler <ibuler@qq.com>
This commit is contained in:
@@ -19,3 +19,16 @@ export default {
|
||||
RequiredChange,
|
||||
EmailCheck
|
||||
}
|
||||
|
||||
export const JsonRequired = {
|
||||
required: true,
|
||||
trigger: 'change',
|
||||
validator: (rule, value, callback) => {
|
||||
try {
|
||||
JSON.parse(value)
|
||||
callback()
|
||||
} catch (e) {
|
||||
callback(new Error(i18n.t('common.InvalidJson')))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -385,7 +385,8 @@
|
||||
"SPECIAL_CHAR_REQUIRED": "须包含特殊字符",
|
||||
"MIN_LENGTH_ERROR": "密码最小长度 {0} 位"
|
||||
},
|
||||
"lastCannotBeDeleteMsg": "最后一项,不能被删除"
|
||||
"lastCannotBeDeleteMsg": "最后一项,不能被删除",
|
||||
"InvalidJson": "不是合法 JSON"
|
||||
},
|
||||
"dashboard": {
|
||||
"ActiveAsset": "近期被登录过",
|
||||
|
||||
@@ -383,7 +383,8 @@
|
||||
"SPECIAL_CHAR_REQUIRED": "Special char required",
|
||||
"MIN_LENGTH_ERROR": "Password minimum length {}"
|
||||
},
|
||||
"lastCannotBeDeleteMsg": "The last one can't be delete"
|
||||
"lastCannotBeDeleteMsg": "The last one can't be delete",
|
||||
"InvalidJson": "Not a valid json format"
|
||||
},
|
||||
"dashboard": {
|
||||
"ActiveAsset": "Asset active",
|
||||
|
||||
@@ -20,6 +20,7 @@ import { testLdapSetting } from '@/api/settings'
|
||||
import ImportDialog from './ImportDialog'
|
||||
import TestLoginDialog from './TestLoginDialog'
|
||||
import { IBox } from '@/components'
|
||||
import { JsonRequired } from '@/components/DataForm/rules'
|
||||
|
||||
export default {
|
||||
name: 'Ldap',
|
||||
@@ -61,7 +62,8 @@ export default {
|
||||
el: {
|
||||
type: 'textarea'
|
||||
},
|
||||
label: this.$t('setting.authLdapUserAttrMap')
|
||||
label: this.$t('setting.authLdapUserAttrMap'),
|
||||
rules: [JsonRequired]
|
||||
}
|
||||
},
|
||||
url: '/api/v1/settings/setting/?category=ldap',
|
||||
@@ -121,7 +123,7 @@ export default {
|
||||
|
||||
<style scoped>
|
||||
.listTable ::v-deep .table-action-right-side{
|
||||
padding-top: 0px !important;
|
||||
padding-top: 0 !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user