diff --git a/package.json b/package.json index 628676e..f212613 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "d3-ots", - "version": "0.4.3", + "version": "0.4.4", "private": true, "scripts": { "serve": "vue-cli-service serve", diff --git a/src/views/SignTX.vue b/src/views/SignTX.vue index 983924a..bff1ae8 100644 --- a/src/views/SignTX.vue +++ b/src/views/SignTX.vue @@ -208,10 +208,19 @@ export default { this.isZipFile = false }, onSignAndDownload () { + const _keyPattern = (value) => { + const pattern = /^[A-Fa-f0-9]{64}$/ + if (!pattern.test(value)) return false + return true + } if (!this.sign.privateKey.length) { this.$message.error('Private key can\'t be empty!') return } + if (!_keyPattern(this.sign.privateKey)) { + this.$message.error('Invalid private key!') + return + } if (this.isZipFile) { this.onSignZip() .then(txs => this.onSaveTransactions(txs))