コード例 #1
0
        public async Task <ActionResult> BadCount(Guid id)
        {
            IBLL.IArticleManager articleManager = new ArticleManager();
            await articleManager.BadCountAdd(id);

            return(Json(new { result = "ok" }));
        }
コード例 #2
0
ファイル: ArticleController.cs プロジェクト: YZH20001/yh
        public async Task <ActionResult> BadCount(Guid id)
        {
            BlogSystem.IBLL.IArticleManager articlrManager = new ArticleManager();
            await articlrManager.BadCountAdd(id);

            return(Json(data: new { result = "OK" }));
        }
コード例 #3
0
        public async Task <ActionResult> BadCount(Guid id)
        {
            string userid = ""; string message;

            if (Request.Cookies["userId"] != null)
            {
                if (!JwtHelper.GetJwtDecode(Request.Cookies["userId"].Value, out userid, out message))
                {
                    return(Json(new { result = message, status = "fail" }));
                }
            }
            string userId = Session["userId"] == null ? userid : Session["userId"].ToString();

            if (userId == "")
            {
                return(Json(new { result = "尚未登陆无法操作!", status = "fail" }));
            }
            IArticleManager articleManager = new ArticleManager();
            await articleManager.BadCountAdd(id, Guid.Parse(userId));

            ArticleDto data = await articleManager.GetOneArticleById(id);

            return(Json(new { status = "ok", goodCount = data.GoodCount, badCount = data.BadCount }));
        }