SourceCode/jiouosdp/Areas/Systems/Controllers/SystemToolsController.cs

(完整代码) 1KB

using RFrameGenerate.BLL;
using RFrameGenerate.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace jiouosdp.Areas.Systems.Controllers
{
    public class SystemToolsController : Controller
    {
        //
        // GET: /Systems/SystemTools/

        public ActionResult Index()
        {
            return View();
        }

        public JsonResult ImageCut()
        {
            var list = RFrameGenerate.BLL.Products.ProductsManage.GetListAll();
            Result result;
            
            try 
	        {	
                if (list == null || list.Count == 0) 
                {
                    result = new Result(false,"没有商品图片");
                    return Json(new { Result = "NO" });
                }
		        foreach (var item in list)
                { 
                    if (string.IsNullOrEmpty(item.ProductImage))
                    {
                        continue;
                    }

                    RFrameGenerate.Common.GraphicHelper.CutImage(Server.MapPath("~" + item.ProductImage), Server.MapPath("~" + DictionaryConst.UpLoadPath.ProductsImagePath));
                }
                return Json(new { Result = "OK" });
	        }
	        catch (Exception err)
	        {
		
		        return Json(new { Result = "NO",Msg=err.Message});
	        }
        }
    }
}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。