config.py 986 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. # -*- coding: utf-8 -*-
  2. # @Author : YY
  3. from ruoyi_common.ruoyi.config import CONFIG_CACHE
  4. class RuoYiConfig:
  5. profile = CONFIG_CACHE.get("ruoyi.profile", "dev")
  6. @property
  7. def upload_path(self) -> str:
  8. """
  9. 获取上传路径
  10. Returns:
  11. str: 上传路径
  12. """
  13. return f"uploads/{self.profile}/upload"
  14. @property
  15. def download_path(self) -> str:
  16. """
  17. 获取下载路径
  18. Returns:
  19. str: 下载路径
  20. """
  21. return f"uploads/{self.profile}/download/"
  22. @property
  23. def avatar_path(self) -> str:
  24. """
  25. 获取头像路径
  26. Returns:
  27. str: 头像路径
  28. """
  29. return f"uploads/{self.profile}/avatar"
  30. @property
  31. def import_path(self) -> str:
  32. """
  33. 获取导入路径
  34. Returns:
  35. str: 导入路径
  36. """
  37. return f"uploads/{self.profile}/import"