let origin, host, protocol;
if (process.env.VUE_APP_CORE_HOST_URL) {
  const hostUrl = new URL(process.env.VUE_APP_CORE_HOST_URL);
  origin = hostUrl.toString();
  host = hostUrl.host;
  protocol = hostUrl.protocol.replace("http", "ws"); // http: => ws:
} else {
  origin = window.location.origin;
  host = window.location.host;
  protocol = window.location.protocol.replace("http", "ws"); // http: => ws:
}

export const FACEID_LINENESS_URL =
  "https://api.megvii.com/faceid/liveness/v2/do?token=";

export const TK_SERVER_HTML_URL = origin;

export const VUE_APP_WK_SERVER_SOCKET =
  protocol + "//" + host + "/api/ws/faceBiopsy";

export const VUE_APP_WK_SERVER_SOCKET_FOR_AUDIO =
  protocol + "//" + host + "/api/ws/fileAnswer";

export const VUE_APP_CONFIG_FILE_SEVER_URL =
  process.env.VUE_APP_CONFIG_FILE_SEVER_URL;

export const VUE_APP_SLS_STORE_NAME = process.env.VUE_APP_SLS_STORE_NAME;

export const FACE_API_MODEL_PATH =
  process.env.VUE_APP_PUBLIC_PATH + "models/20190620/";

// export const EPCC_DOMAIN = "iepcc-ps.ecs.qmth.com.cn";
export const EPCC_DOMAIN = "bds.ecs.qmth.com.cn";
export const CUG_DOMAIN = "cug.ecs.qmth.com.cn";
// export const CUG_DOMAIN = "ecs-test.qmth.com.cn";

let domain;
if (process.env.VUE_APP_SELF_DEFINE_DOMAIN === "true") {
  domain = window.localStorage.getItem("exam_cloud_domain_in_url");
}
if (!domain) domain = window.location.hostname.split(".")[0];
export const DOMAIN_IN_URL = domain + ".ecs.qmth.com.cn";

export const PRIVACY_READ_VERSION_NUMBER = "1";
