Authored by TaoHuang

fix image url

import * as Types from './types';
function getUploadImgAbsoluteUrl(url, bucket = 'goodsimg') {
if (!url) {
return null;
}
let urlArr = url.split('/'),
stag = urlArr[urlArr.length - 1].substr(0, 2),
domain = `static.yhbimg.com/${bucket}`;
url = domain + url;
if (stag === '01') {
return `//img11.${url}`;
} else if (stag === '03') {
return `//flv01.${url}`;
} else {
return `//img12.${url}`;
}
}
function _url({ name }) {
return `//img01.yohoboys.com/${name}`;
return getUploadImgAbsoluteUrl(name);
}
function _handleData(data) {
... ...