根据location.host判断api的host
This commit is contained in:
parent
e6164734a9
commit
2facd8f67a
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user