config.js 550 B

1234567891011121314151617181920212223242526272829
  1. const STAGE_CONFIG = {
  2. "api-mock": {
  3. path: "api-mock",
  4. },
  5. dev: {
  6. path: "/api",
  7. },
  8. prod: {
  9. path: "",
  10. },
  11. };
  12. let stageKey = window.localStorage.getItem("stage");
  13. if (process.env.NODE_ENV === "production") {
  14. stageKey = "prod";
  15. } else {
  16. stageKey = "dev";
  17. }
  18. const stage = STAGE_CONFIG[stageKey || "api-mock"];
  19. // 0:已创建;1:已创建任务;2:任务运行中;3:已完成
  20. const orderStatus = {
  21. 0: "等待中",
  22. 1: "已创建任务",
  23. 2: "任务运行中",
  24. 3: "已完成",
  25. };
  26. export { stage, orderStatus };