Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
mingzhenliu committed Jul 14, 2021
1 parent 91af9c9 commit aa0f828
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,7 @@ public Contract updateContract(ReqContractSave contractReq) {
contract.setModifyTime(LocalDateTime.now());
if(contract.getContractAddress()!=null && contract.getContractAddress().length()>("0x").length())
{

contract.setContractStatus(ContractStatus.DEPLOYED.getValue());
}
contractRepository.save(contract);
Expand Down
1 change: 1 addition & 0 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"js-base64": "^2.5.1",
"js-cookie": "^2.2.0",
"js-sha256": "^0.9.0",
"jshint": "^2.13.0",
"jszip": "^3.5.0",
"lodash": "^4.17.15",
"mavon-editor": "^2.9.1",
Expand Down
4 changes: 2 additions & 2 deletions web/src/lang/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ export default {
paramsInfo: 'If the parameter type is an array, enter the following format, comma separated, with double quotes for non-numeric and Boolean values, such as ["aaa","bbb"] and [100,101]; Escape if array parameters contain double quotes, for example: ["aaa\\"bbb","ccc"].',
contractAddress: "Address",
method: "Method",
contractAddressInput: "Please enter the contract address",
contractAddressInput: "Please enter the correct contract address",
contractAddressInfo: "Optional item,import deployed contract addresses.",
selectUser: "Please Select Users",
methodType: "Method Type",
Expand Down Expand Up @@ -594,4 +594,4 @@ export default {
uploadNumLimit: "Only one file can be uploaded, and no more than 5000kb.",
user: "User"
}
}
}
2 changes: 1 addition & 1 deletion web/src/lang/zh.js
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ export default {
paramsInfo: '如果参数类型是数组,请按照以下格式输入,以逗号分隔,非数值和布尔值须使用双引号,例如:["aaa","bbb"]和[100,101];如果数组参数包含双引号,需转义,例如:["aaa\\"bbb","ccc"]。',
contractAddress: "合约地址",
method: "方法",
contractAddressInput: "请输入合约地址",
contractAddressInput: "请输入正确的合约地址",
contractAddressInfo: "选填项,导入已部署的合约地址。",
selectUser: "请选择用户",
methodType: "方法类型",
Expand Down
33 changes: 26 additions & 7 deletions web/src/views/chaincode/components/code.vue
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,10 @@
<span v-else style="color:#1f83e7;cursor: pointer;margin-left: 10px;" @click="handleRegisterCns">{{$t('text.register')}}</span>
</span>
</div>
<div v-else class="contract-info-list">
<span v-if="bytecodeBin" class="contract-info-list-title" style="color: #0B8AEE">contractAddress
<div v-else v-show="abiFile" class="contract-info-list">
<span v-if="!abiEmpty" class="contract-info-list-title" style="color: #0B8AEE">contractAddress
</span>
<span v-if="bytecodeBin" style="color:#1f83e7;cursor: pointer;margin-left: 10px;" @click="addContractAddress">{{$t('text.addContractAddress')}}</span>
<span v-if="!abiEmpty" style="color:#1f83e7;cursor: pointer;margin-left: 10px;" @click="addContractAddress">{{$t('text.addContractAddress')}}</span>
</div>
<div class="contract-info-list" v-if="abiFile">
<span class="contract-info-list-title" style="color: #0B8AEE">contractName
Expand Down Expand Up @@ -252,6 +252,7 @@ export default {
code: "",
status: 0,
abiFile: "",
abiEmpty: true,
bin: "",
contractAddress: "",
contractName: "",
Expand Down Expand Up @@ -361,6 +362,7 @@ export default {
this.version = "";
this.status = null;
this.abiFile = "";
this.abiEmpty = true,
this.contractAddress = "";
this.errorMessage = "";
this.contractName = "";
Expand All @@ -372,6 +374,8 @@ export default {
this.aceEditor.setValue(this.content);
this.status = data.contractStatus;
this.abiFile = data.contractAbi;
if (!(!this.abiFile || this.abiFile == '[]'))
{this.abiEmpty = false}
this.contractAddress = data.contractAddress;
this.errorMessage = data.description || "";
this.contractName = data.contractName;
Expand All @@ -398,6 +402,7 @@ export default {
this.version = "";
this.status = null;
this.abiFile = "";
this.abiEmpty = true;
this.contractAddress = "";
this.errorMessage = "";
this.contractName = "";
Expand Down Expand Up @@ -741,6 +746,8 @@ export default {
this.successInfo = `< ${this.$t('text.compilationSucceeded')}`;
this.abiFile = compiledMap.abi;
this.abiFile = JSON.stringify(this.abiFile);
if (!(!this.abiFile || this.abiFile == '[]'))
{this.abiEmpty = false}
this.bin = compiledMap.evm.deployedBytecode.object;
this.bytecodeBin = compiledMap.evm.bytecode.object;
this.data.contractAbi = this.abiFile;
Expand Down Expand Up @@ -774,6 +781,7 @@ export default {
this.errorInfo = "";
this.compileinfo = "";
this.abiFile = "";
this.abiEmpty = true;
this.contractAddress = "";
this.bin = "";
},
Expand Down Expand Up @@ -813,7 +821,6 @@ export default {
this.dialogUser = false;
},
setMethod: function () {
let Web3EthAbi = web3;
let arry = [];
if (this.abiFile) {
let list = JSON.parse(this.abiFile);
Expand Down Expand Up @@ -1250,9 +1257,21 @@ export default {
type: "error",
message: this.$t('contracts.contractAddressInput')
});
} else {
this.addContractAddressVisible = false;
this.addContract()
}
else {
let web3Utils = require("web3-utils");
if(web3Utils.isAddress(this.contractForm.contractAddress))
{
this.addContractAddressVisible = false;
this.addContract();
}
else
{
this.$message({
type: "error",
message: this.$t('contracts.contractAddressInput')
});
}
}
} else {
return false;
Expand Down
2 changes: 1 addition & 1 deletion web/src/views/chaincode/dialog/exportProject.vue
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ export default {
setTimeout(() => {
num =0;
this.getContractList(val,true);
}, 1000)
}, 3000)
}
this.multipleSelectedId = Array.from(new Set(this.multipleSelectedId))
},
Expand Down

0 comments on commit aa0f828

Please sign in to comment.