|
@@ -61,15 +61,17 @@ export function random(prefix) {
|
61
|
61
|
* @param {*} url
|
62
|
62
|
* @returns
|
63
|
63
|
*/
|
64
|
|
-export function compressImage(url) {
|
|
64
|
+export function compressImage(url, typ) {
|
65
|
65
|
if (!url) return url;
|
66
|
66
|
|
67
|
67
|
// GIF 不压缩
|
68
|
68
|
if (url.indexOf('.gif') > -1) return url;
|
69
|
69
|
|
|
70
|
+ const style = typ || 'cmp80'
|
|
71
|
+
|
70
|
72
|
// eslint-disable-next-line no-undef
|
71
|
73
|
if (url.indexOf(OSS) > -1) {
|
72
|
|
- return `${url}?x-oss-process=style/cmp80`
|
|
74
|
+ return `${url}?x-oss-process=style/${style}`.replace('http://', 'https://')
|
73
|
75
|
}
|
74
|
76
|
|
75
|
77
|
return url;
|