增加后台功能
This commit is contained in:
@@ -5,6 +5,9 @@ using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using COMCMS.Web.Models;
|
||||
using COMCMS.Common;
|
||||
using COMCMS.Core;
|
||||
using XCode;
|
||||
|
||||
namespace COMCMS.Web.Controllers
|
||||
{
|
||||
@@ -18,13 +21,20 @@ namespace COMCMS.Web.Controllers
|
||||
public IActionResult About()
|
||||
{
|
||||
ViewData["Message"] = "Your application description page.";
|
||||
|
||||
CookiesHelper.WriteCookie("abc", Utils.GetRandomChar(20), 10);
|
||||
//sessiong
|
||||
SessionHelper.WriteSession("bcd", Utils.GetRandomChar(20));
|
||||
return View();
|
||||
}
|
||||
|
||||
public IActionResult Contact()
|
||||
{
|
||||
ViewData["Message"] = "Your contact page.";
|
||||
Config cfg = Config.FindById(1);
|
||||
ViewBag.siteName = cfg.SiteName;
|
||||
|
||||
ViewBag.c = CookiesHelper.GetCookie("abc");
|
||||
ViewBag.d = Utils.SIGNSALT;
|
||||
|
||||
return View();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using COMCMS.Common;
|
||||
using COMCMS.Core;
|
||||
using XCode;
|
||||
|
||||
// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
|
||||
|
||||
namespace COMCMS.Web.Controllers.api
|
||||
{
|
||||
[Route("api/[controller]")]
|
||||
public class IndexController : Controller
|
||||
{
|
||||
// GET: api/<controller>
|
||||
[HttpGet]
|
||||
public object Get()
|
||||
{
|
||||
Config cfg = Config.GetSystemConfig();
|
||||
return cfg;
|
||||
}
|
||||
|
||||
// GET api/<controller>/5
|
||||
[HttpGet("{id}")]
|
||||
public string Get(int id)
|
||||
{
|
||||
return "value";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user