mirror of
https://github.com/jumpserver/lina.git
synced 2026-01-25 14:34:46 +00:00
perf: 修复创建资产账号密码重复加密问题
This commit is contained in:
@@ -32,6 +32,11 @@ export default {
|
||||
account: {
|
||||
type: Object,
|
||||
default: null
|
||||
},
|
||||
// 默认组件密码加密
|
||||
encryptPassword: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@@ -233,7 +238,7 @@ export default {
|
||||
form.secret = form[secretType]
|
||||
delete form[secretType]
|
||||
}
|
||||
form.secret = encryptPassword(form.secret)
|
||||
form.secret = this.encryptPassword ? encryptPassword(form.secret) : form.secret
|
||||
if (!form.secret) {
|
||||
delete form['secret']
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
<script>
|
||||
import GenericCreateUpdatePage from '@/layout/components/GenericCreateUpdatePage'
|
||||
import { assetFieldsMeta } from '@/views/assets/const'
|
||||
import { encryptPassword } from '@/utils/crypto'
|
||||
|
||||
export default {
|
||||
components: { GenericCreateUpdatePage },
|
||||
@@ -65,6 +66,11 @@ export default {
|
||||
if (values.nodes && values.nodes.length === 0) {
|
||||
delete values['nodes']
|
||||
}
|
||||
const accounts = values?.accounts || []
|
||||
values.accounts = accounts.map((item) => {
|
||||
item['secret'] = encryptPassword(item['secret'])
|
||||
return item
|
||||
})
|
||||
|
||||
return values
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
<AccountCreateForm
|
||||
:platform="platform"
|
||||
:account="account"
|
||||
:encrypt-password="false"
|
||||
@add="addAccount"
|
||||
@edit="editAccount"
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user