diff --git a/src/components/EditSites.vue b/src/components/EditSites.vue index f4cc760..a3918cb 100644 --- a/src/components/EditSites.vue +++ b/src/components/EditSites.vue @@ -81,6 +81,9 @@ + + + 取消 @@ -109,6 +112,7 @@ export default { dialogType: 'new', dialogVisible: false, siteInfo: { + key: '', name: '', api: '', download: '', @@ -191,6 +195,7 @@ export default { this.dialogType = 'new' this.dialogVisible = true this.siteInfo = { + key: '', name: '', api: '', download: '', @@ -232,7 +237,7 @@ export default { } var randomstring = require('randomstring') var doc = { - key: this.dialogType === 'edit' ? this.siteInfo.key : randomstring.generate(6), + key: this.dialogType === 'edit' ? this.siteInfo.key : this.siteInfo.key ? this.siteInfo.key : randomstring.generate(6), id: this.dialogType === 'edit' ? this.siteInfo.id : this.sites[this.sites.length - 1].id + 1, name: this.siteInfo.name, api: this.siteInfo.api, @@ -245,6 +250,7 @@ export default { if (this.dialogType === 'edit') sites.remove(this.siteInfo.id) sites.add(doc).then(res => { this.siteInfo = { + key: '', name: '', api: '', download: '',