Authored by 郭成尧

query

... ... @@ -28,7 +28,7 @@ const imgSrcHandle = (imgUrl, params) => {
}
imgUrl = url;
} else if (/imageView2/.test(query)) {
if (!/\/q\/\d+/.test(imgUrl)) {
if (!/\/q\/\d+/.test(query)) {
imgUrl += `/q/${params.q}`;
} else {
imgUrl = imgUrl.replace(/\/q\/\d+/g, '/q/' + params.q);
... ... @@ -42,13 +42,13 @@ const imgSrcHandle = (imgUrl, params) => {
imgUrl = imgUrl.replace(/format\/png/i, 'format/webp').replace(/format\/jpg/i, 'format/webp');
}
} else if (/imageMogr2/.test(query)) {
if (!/\/quality\/\d+/.test(imgUrl)) {
if (!/\/quality\/\d+/.test(query)) {
imgUrl += `/quality/${params.q}`;
} else {
imgUrl = imgUrl.replace(/\/quality\/\d+/g, '/quality/' + params.q);
}
if (window.supportWebp && !/format\//.test(imgUrl)) {
if (window.supportWebp && !/format\//.test(query)) {
imgUrl += '/format/webp';
}
... ...