Nenhuma descrição

utils-f64eef69.js 1.0KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import { _ as _defineProperty } from './_commonjsHelpers-aeb41076.js';
  2. var IMAGE_PROCESS = '?x-oss-process=image/resize,h_350';
  3. var IMAGE_PROCESS_SMALL = '?x-oss-process=image/resize,h_100';
  4. var IMAGE_PROCESS_LARGE = '?x-oss-process=image/resize,h_500';
  5. function addImageProcess(url) {
  6. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
  7. width: '36px',
  8. height: '36px'
  9. };
  10. // 防止重复添加导致的url不正确
  11. if (url && url.indexOf('x-oss-process') > -1) {
  12. return url;
  13. }
  14. if (options.small) {
  15. return url + IMAGE_PROCESS_SMALL;
  16. }
  17. if (options.large) {
  18. return url + IMAGE_PROCESS_LARGE;
  19. }
  20. if (options.custom) {
  21. return "".concat(url, "?x-oss-process=image/resize,limit_0,m_fill,w_").concat(options.width, ",h_").concat(options.height);
  22. }
  23. return url + IMAGE_PROCESS;
  24. }
  25. function exportStyleSizeClass(styles, size) {
  26. return _defineProperty({}, styles[size], true);
  27. }
  28. export { addImageProcess as a, exportStyleSizeClass as e };
  29. //# sourceMappingURL=utils-f64eef69.js.map