TokenController.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using LeaRun.Application.Code;
  2. using LeaRun.Util;
  3. using System.Web.Mvc;
  4. namespace LeaRun.Application.Web.Areas.WeChatManage.Controllers
  5. {
  6. /// <summary>
  7. /// 版 本 6.1
  8. /// Copyright (c) 2013-2016 上海力软信息技术有限公司
  9. /// 创建人:佘赐雄
  10. /// 日 期:2015.12.23 11:31
  11. /// 描 述:企业号设置
  12. /// </summary>
  13. public class TokenController : MvcControllerBase
  14. {
  15. #region 视图功能
  16. /// <summary>
  17. /// 企业号管理
  18. /// </summary>
  19. /// <returns></returns>
  20. [HttpGet]
  21. [HandlerAuthorize(PermissionMode.Enforce)]
  22. public ActionResult Index()
  23. {
  24. ViewBag.CorpId = Config.GetValue("CorpId");
  25. ViewBag.CorpSecret = Config.GetValue("CorpSecret");
  26. return View();
  27. }
  28. #endregion
  29. #region 提交数据
  30. /// <summary>
  31. /// 保存
  32. /// </summary>
  33. /// <param name="CorpId">企业号CorpID</param>
  34. /// <param name="CorpSecret">管理组凭证密钥</param>
  35. /// <returns></returns>
  36. [HttpPost]
  37. [ValidateAntiForgeryToken]
  38. [AjaxOnly]
  39. public ActionResult SaveForm(string CorpId, string CorpSecret)
  40. {
  41. Config.SetValue("CorpId", CorpId);
  42. Config.SetValue("CorpSecret", CorpSecret);
  43. return Success("操作成功。");
  44. }
  45. #endregion
  46. }
  47. }