fix: Account tempalte update secret failed

This commit is contained in:
feng
2024-06-18 14:47:18 +08:00
parent 76b6aebac4
commit 53b00421d2
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('UpdateSuccessMsg'))
})
},

View File

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