Authored by ccbikai(👎🏻🍜)

店铺 bannel 兼容

'use strict';
const url = require('url');
const _ = require('lodash');
const config = require('../config/common');
const assetUrl = config.assetUrl;
... ... @@ -9,7 +10,7 @@ module.exports = {
return url.resolve(assetUrl, imgSrc);
},
image2: function(imageUrl, opts) {
if (imageUrl) {
if (imageUrl && _.isString(imageUrl)) {
let params = opts.hash;
let urls = imageUrl.split('?');
let query = urls[1] || '';
... ... @@ -50,7 +51,7 @@ module.exports = {
}
return uri + '?' + query;
} else {
return imageUrl;
return '';
}
},
ifor: function() {
... ...