import { filePath } from "@/config/settings";
/**
 * 文件路径拼接
 */

export function fetchFileUrl(fileUrl = "", app = window.$nuxt) {
  let realUrl = "";
  if (fileUrl.includes("http://") || fileUrl.includes("https://")) {
    realUrl = fileUrl;
  } else {
    realUrl = app.$store.state.app.systemConfig.FILE_SERVER + fileUrl;
  }
  return realUrl;
}

/**
 * 文件下载地址拼接
 */

export function fetchFileUrlDownload(fileUrl, app) {
  let realUrl = "";
  if (fileUrl.includes("http://") || fileUrl.includes("https://")) {
    realUrl = fileUrl;
  } else {
    realUrl = app.$store.state.app.systemConfig.FILE_DOWNLOAD_SERVER + fileUrl;
  }
  return realUrl;
}
