Exemple #1
0
        public async Task <WebResponseContent> CreatePage(Hiiops_Cart cart)
        {
            WebResponseContent webResponseContent = WebResponseContent.Instance;

            if (cart == null)
            {
                return(webResponseContent.Error("未获取到数据"));
            }
            if (!await repository.ExistsAsync(x => x.Id == cart.Id))
            {
                return(webResponseContent.Error("请求的数据已发生变化,请刷新页面重新提交"));
            }
            string template = FileHelper.ReadFile(@"Template\\AppHtml\\cart.html");

            if (string.IsNullOrEmpty(template))
            {
                return(webResponseContent.Error("未获取到页面的模板,请确认模板是否存在"));
            }
            string filePath;
            string fileName;
            string urlPath;

            if (!string.IsNullOrEmpty(cart.StaticUrl) && cart.StaticUrl.IndexOf("/") != -1 && cart.StaticUrl.Split(".").Length == 2)
            {
                var file = cart.StaticUrl.Split("/");
                fileName = file[^ 1];
Exemple #2
0
 public async Task <IActionResult> CreatePage([FromBody] Hiiops_Cart cart)
 {
     return(Json(await Service.CreatePage(cart)));
 }