fix: Account tempalte update secret failed

This commit is contained in:
feng
2024-06-18 14:52:50 +08:00
parent 1ff49ca16d
commit 4e95c88318
2 changed files with 7 additions and 1 deletions

View File

@@ -83,6 +83,10 @@ export default {
type: String,
default: ''
},
type: {
type: String,
default: 'account'
},
title: {
type: String,
default: function() {
@@ -136,7 +140,8 @@ export default {
name: this.secretInfo.name,
secret: encryptPassword(this.modifiedSecret)
}
this.$axios.patch(`/api/v1/accounts/accounts/${this.account.id}/`, params).then(() => {
const url = this.type === 'account' ? `/api/v1/accounts/accounts` : `/api/v1/accounts/account-templates`
this.$axios.patch(`${url}/${this.account.id}/`, params).then(() => {
this.$message.success(this.$tc('common.updateSuccessMsg'))
})
},

View File

@@ -6,6 +6,7 @@
:account="account"
:show-password-record="false"
:url="secretUrl"
type="template"
:visible.sync="showViewSecretDialog"
/>
</div>