From bfedae38f172556b1799ddfcb76b0bc2d5e72b4d Mon Sep 17 00:00:00 2001 From: liangping <18786721@qq.com> Date: Fri, 15 Dec 2023 17:41:22 +0800 Subject: [PATCH] apply chain id in url --- src/components/WasmVerification.vue | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/components/WasmVerification.vue b/src/components/WasmVerification.vue index 8c74e554..e20631bc 100644 --- a/src/components/WasmVerification.vue +++ b/src/components/WasmVerification.vue @@ -14,17 +14,14 @@ const baseurl = "https://prod.compiler.welldonestudio.io" const verification = ref({}); -const chainId = computed(() => { - const base = useBaseStore() - return base.latest?.block?.header?.chain_id || "unknown" -}) - -console.log("contract:", props.contract) - onMounted(() => { + const base = useBaseStore() + const chainId = base.latest?.block?.header?.chain_id || "neutron-1" // console.log("mounted", `${baseurl}/deploy-histories/neutron?contract=${props.contract}`, chainId.value) - get(`${baseurl}/deploy-histories/neutron?contract=${props.contract}`).then((x) => { + const url = `${baseurl}/deploy-histories/${chainId}?contract=${props.contract}` + console.log("url:", url) + get(url).then((x) => { console.log("verification:", x) verification.value = x }).catch(e => { @@ -39,7 +36,7 @@ function verify() { const data = {"contractAddress": props.contract, "chainId": id} post(`${baseurl}/verification/neutron`, data).then((x)=> { - verification.value = x.result + if(x.result) verification.value = x.result }) }