diff --git a/assets/scripts/confirm.js b/assets/scripts/confirm.js index dfa3333..28832d1 100644 --- a/assets/scripts/confirm.js +++ b/assets/scripts/confirm.js @@ -1,5 +1,6 @@ const { createApp } = Vue; const API_BASE = "https://xwork.kingsome.cn"; +const API_BASE_LOCAL = "http://localhost:3002"; const TASK_INFO_URL = "/workflow/task"; const DEFAULT_CHAIN_DATA = { @@ -53,7 +54,8 @@ async function connectMetaMask() { } const fetchTaskInfo = function (taskId) { - const url = `${API_BASE}${TASK_INFO_URL}/${taskId}`; + const host = location.host === "localhost" ? API_BASE_LOCAL : API_BASE; + const url = `${host}${TASK_INFO_URL}/${taskId}`; return fetch(url) .then((response) => { if (!response.ok) {