utils.js
452 Bytes
export const getImgUrl = function(src, width = 300, height = 300, mode = 2) {
return src ? src.replace(/(\{width}|\{height}|\{mode})/g, function($0) {
const dict = {
'{width}': width,
'{height}': height,
'{mode}': mode || 2
};
return dict[$0];
}).replace(/https?:/, '') + '/interlace/1' : '';
};
export const replaceHttp = function(src) {
return src.replace(/https?:/, '');
};