微店模拟接口 其他一些功能优化
This commit is contained in:
1 parent
dc6f981a34
commit
cafdbbd95d
20 files changed
+2343
-103
No files matched your search
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace TemuKJD.BLL.VDian
|
||||
{
|
||||
public class MappingVDianApiBLL
|
||||
{
|
||||
public static string GetFormattedImgFileName(string oldName)
|
||||
{
|
||||
if (oldName == null)
|
||||
return "";
|
||||
var imgStr = oldName;
|
||||
if (imgStr.EndsWith(".src"))
|
||||
imgStr = imgStr.Substring(0, imgStr.Length - 4);
|
||||
if (imgStr.Contains("@"))
|
||||
imgStr = imgStr.Substring(0, imgStr.LastIndexOf("@")); //omsproductionimg.yangkeduo.com/images/2017-12-06/c5286b86a0ef6a982dcabbdf517a7d55.jpeg@750w_1l_50Q.src
|
||||
if (imgStr.Contains("?") && !imgStr.ToLower().EndsWith(".jpg") && !imgStr.ToLower().EndsWith(".jpeg") && !imgStr.ToLower().EndsWith(".bmp")
|
||||
&& !imgStr.ToLower().EndsWith(".png") && !imgStr.ToLower().EndsWith(".ss2") && !imgStr.ToLower().EndsWith(".gif"))
|
||||
imgStr = imgStr.Substring(0, imgStr.LastIndexOf("?"));
|
||||
if (!imgStr.StartsWith("http"))
|
||||
imgStr = "https://" + imgStr.TrimStart('/');
|
||||
if (!imgStr.ToLower().EndsWith(".jpg") && !imgStr.ToLower().EndsWith(".jpeg") && !imgStr.ToLower().EndsWith(".png") && !imgStr.ToLower().EndsWith(".bmp")
|
||||
&& !imgStr.ToLower().EndsWith(".ss2") && !imgStr.ToLower().EndsWith(".gif"))
|
||||
{
|
||||
if (imgStr.Contains("gw.alicdn.com"))
|
||||
return imgStr;
|
||||
return "";
|
||||
}
|
||||
return imgStr;
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user