index.ts 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import { isMp } from "@/cool";
  2. import { dev } from "./dev";
  3. import { prod } from "./prod";
  4. // 判断当前是否为开发环境
  5. export const isDev = process.env.NODE_ENV == "development";
  6. // 忽略 token 校验的接口路径
  7. export const ignoreTokens: string[] = [];
  8. // 微信配置
  9. type WxConfig = {
  10. debug: boolean;
  11. };
  12. // 配置类型定义
  13. type Config = {
  14. name: string; // 应用名称
  15. version: string; // 应用版本
  16. locale: string; // 应用语言
  17. website: string; // 官网地址
  18. host: string; // 主机地址
  19. baseUrl: string; // 基础路径
  20. showDarkButton: boolean; // 是否显示暗色模式切换按钮
  21. isCustomTabBar: boolean; // 是否自定义 tabBar
  22. backTop: boolean; // 是否显示回到顶部按钮
  23. wx: WxConfig; // 微信配置
  24. };
  25. // 根据环境导出最终配置
  26. export const config = {
  27. name: "Cool Unix",
  28. version: "1.0.0",
  29. locale: "zh",
  30. website: "https://cool-js.com",
  31. showDarkButton: isMp() ? false : true,
  32. isCustomTabBar: true,
  33. backTop: true,
  34. wx: {
  35. debug: false
  36. },
  37. ...(isDev ? dev() : prod())
  38. } as Config;
  39. // 导出代理相关配置
  40. export * from "./proxy";