captain-invalid-goods
Advanced tools
Comparing version 0.3.0 to 0.3.1
@@ -1145,3 +1145,5 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
function getCdnImageUrl(url, parameter) { | ||
function getCdnImageUrl(url) { | ||
var parameter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; | ||
if (!url) { | ||
@@ -1151,11 +1153,15 @@ return (0, _readConfig2['default'])('url.cdn_static') + '/image/wap/no_pic.png'; | ||
// 如果已经是指定尺寸的 cdn 地址,不改尺寸 | ||
if (url.match(/.+!\d+x\d+.+/)) { | ||
parameter = ''; | ||
} else { | ||
parameter = !!parameter && parameter.length > 0 ? parameter : '!100x100.jpg'; | ||
var CDN_DOMAIN = 'yzcdn.cn/'; | ||
var containSize = url.match(/.+!\d+x\d+.+/); | ||
var containProtocal = url.match(/^(https?:)?\/\//i); | ||
var isCDNImage = url.indexOf(CDN_DOMAIN) !== -1; | ||
// 若未指定尺寸,且为 yzcdn 域名,则默认指定 100 * 100 尺寸 | ||
if (!containSize && !parameter && (isCDNImage || !containProtocal)) { | ||
parameter = '!100x100.jpg'; | ||
} | ||
if (!url.match(/^(https?:)?\/\//i)) { | ||
return (0, _readConfig2['default'])('url.imgqn') + '/' + url + parameter; | ||
if (!containProtocal) { | ||
url = url[0] !== '/' ? '/' + url : url; | ||
return '' + (0, _readConfig2['default'])('url.imgqn') + url + parameter; | ||
} | ||
@@ -1174,3 +1180,6 @@ | ||
function site(url, prefix) { | ||
function site() { | ||
var url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; | ||
var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; | ||
var env = (0, _readConfig2['default'])('env'); | ||
@@ -1177,0 +1186,0 @@ var base = (0, _readConfig2['default'])('url'); |
{ | ||
"name": "captain-invalid-goods", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "不可用商品列表组件", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
57417
1038