diff --git a/dist/index.html b/dist/index.html index 8ce32c35..bfc7c54a 100755 --- a/dist/index.html +++ b/dist/index.html @@ -11,7 +11,7 @@ vertical-align: -0.15em; fill: currentColor; overflow: hidden; - }
+ + diff --git a/src/views/chaincode/components/code.vue b/src/views/chaincode/components/code.vue index ad70c999..660b07f3 100755 --- a/src/views/chaincode/components/code.vue +++ b/src/views/chaincode/components/code.vue @@ -194,17 +194,7 @@ export default { Bus.$off("noData") }, beforeMount() { - var head = document.head; - var script = document.createElement("script"); - if(localStorage.getItem("encryptionId") == 1){ - script.src = "./static/js/soljson-v0.4.25-gm.js"; - }else{ - script.src = "./static/js/soljson-v0.4.25+commit.59dbf8f1.js"; - } - script.setAttribute('id', 'soljson'); - if (!document.getElementById('soljson')) { - head.append(script) - } + }, mounted: function () { if (localStorage.getItem("root") === "admin") { @@ -239,19 +229,19 @@ export default { this.version = data.contractVersion; this.complieAbiTextHeight = false; this.complieBinTextHeight = false; - this.$refs['showAbiText'].style.overflow = 'hidden' - this.$refs['showBinText'].style.overflow = 'hidden' - if (data.contractAbi) { - this.$nextTick(() => { - if (this.$refs['showAbiText'].offsetHeight >= 72) { - this.complieAbiTextHeight = true - } - if (this.$refs['showBinText'].offsetHeight >= 72) { - this.complieBinTextHeight = true - } + // this.$refs['showAbiText'].style.overflow = 'hidden' + // this.$refs['showBinText'].style.overflow = 'hidden' + // if (data.contractAbi) { + // this.$nextTick(() => { + // if (this.$refs['showAbiText'].offsetHeight >= 72) { + // this.complieAbiTextHeight = true + // } + // if (this.$refs['showBinText'].offsetHeight >= 72) { + // this.complieBinTextHeight = true + // } - }) - } + // }) + // } }) Bus.$on("noData", data => { diff --git a/src/views/chaincode/contract.vue b/src/views/chaincode/contract.vue index 2a42211e..e13bcd49 100755 --- a/src/views/chaincode/contract.vue +++ b/src/views/chaincode/contract.vue @@ -31,6 +31,7 @@ import menu from "./components/contractCatalog"; import codes from "./components/code"; import contentHead from "@/components/contentHead"; +import { encryption } from "@/util/api"; export default { name: "contract", components: { @@ -70,8 +71,42 @@ export default { } } }, - mounted: function() {}, + mounted: function() { + this.getEncryption(this.initSolc); + }, methods: { + initSolc() { + var head = document.head; + var script = document.createElement("script"); + if (localStorage.getItem("encryptionId") == 0) { + script.src = "./static/js/soljson-v0.4.25+commit.59dbf8f1.js"; + } else { + script.src = "./static/js/soljson-v0.4.25-gm.js"; + } + script.setAttribute('id', 'soljson'); + if (!document.getElementById('soljson')) { + head.append(script) + } + }, + getEncryption: function (callback) { + encryption().then(res => { + if (res.status == 200) { + localStorage.setItem("encryptionId", res.data.data) + callback(); + } else { + this.$message({ + type: "error", + message: this.$chooseLang(res.data.code) + }); + } + }) + .catch(err => { + this.$message({ + type: "error", + message: this.$t('text.systemError') + }); + }); + }, changGroup: function(){ this.$refs.menu.getContracts() }, diff --git a/src/views/chaincode/dialog/editor.vue b/src/views/chaincode/dialog/editor.vue index f4373a0f..ab7a467c 100644 --- a/src/views/chaincode/dialog/editor.vue +++ b/src/views/chaincode/dialog/editor.vue @@ -75,8 +75,7 @@