Authored by 郭成尧

query

@@ -28,7 +28,7 @@ const imgSrcHandle = (imgUrl, params) => { @@ -28,7 +28,7 @@ const imgSrcHandle = (imgUrl, params) => {
28 } 28 }
29 imgUrl = url; 29 imgUrl = url;
30 } else if (/imageView2/.test(query)) { 30 } else if (/imageView2/.test(query)) {
31 - if (!/\/q\/\d+/.test(imgUrl)) { 31 + if (!/\/q\/\d+/.test(query)) {
32 imgUrl += `/q/${params.q}`; 32 imgUrl += `/q/${params.q}`;
33 } else { 33 } else {
34 imgUrl = imgUrl.replace(/\/q\/\d+/g, '/q/' + params.q); 34 imgUrl = imgUrl.replace(/\/q\/\d+/g, '/q/' + params.q);
@@ -42,13 +42,13 @@ const imgSrcHandle = (imgUrl, params) => { @@ -42,13 +42,13 @@ const imgSrcHandle = (imgUrl, params) => {
42 imgUrl = imgUrl.replace(/format\/png/i, 'format/webp').replace(/format\/jpg/i, 'format/webp'); 42 imgUrl = imgUrl.replace(/format\/png/i, 'format/webp').replace(/format\/jpg/i, 'format/webp');
43 } 43 }
44 } else if (/imageMogr2/.test(query)) { 44 } else if (/imageMogr2/.test(query)) {
45 - if (!/\/quality\/\d+/.test(imgUrl)) { 45 + if (!/\/quality\/\d+/.test(query)) {
46 imgUrl += `/quality/${params.q}`; 46 imgUrl += `/quality/${params.q}`;
47 } else { 47 } else {
48 imgUrl = imgUrl.replace(/\/quality\/\d+/g, '/quality/' + params.q); 48 imgUrl = imgUrl.replace(/\/quality\/\d+/g, '/quality/' + params.q);
49 } 49 }
50 50
51 - if (window.supportWebp && !/format\//.test(imgUrl)) { 51 + if (window.supportWebp && !/format\//.test(query)) {
52 imgUrl += '/format/webp'; 52 imgUrl += '/format/webp';
53 } 53 }
54 54