fix vali middleware

This commit is contained in:
HTR
2018-07-02 18:15:35 +08:00
parent 2e19235619
commit 1b5155aeaa
14 changed files with 358 additions and 226 deletions
+19 -27
View File
@@ -5,6 +5,7 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using COMCMS.Common;
using COMCMS.Core;
using COMCMS.Web.Filter;
using XCode;
// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
@@ -12,7 +13,7 @@ using XCode;
namespace COMCMS.Web.Controllers.api
{
public class IndexController : APIBaseController
public class IndexController : Controller
{
// GET: api/<controller>
[HttpGet]
@@ -22,7 +23,7 @@ namespace COMCMS.Web.Controllers.api
return cfg;
}
#region 测试验签
//#region 测试验签
/// <summary>
/// 测试验签
/// </summary>
@@ -31,31 +32,22 @@ namespace COMCMS.Web.Controllers.api
/// <param name="timeStamp"></param>
/// <param name="signature"></param>
/// <returns></returns>
[HttpGet]
public object CheckSign(string id, string random = "", string timeStamp = "", string signature = "")
{
if (!AutoCheckQueryStringSignature())
{
reJson.message = "验签失败!";
return reJson;
}
else
{
reJson.code = 0;
reJson.message = "验签成功!";
return reJson;
}
}
#endregion
//[HttpGet]
//[CheckFilter]
//public ReJSON CheckSign(string id, string random = "", string timeStamp = "", string signature = "")
//{
// return new ReJSON("验签成功!");
//}
//#endregion
#region 测试出错
[HttpGet]
public object GetTest()
{
int a = 1,b=0;
var c = a / b;
return reJson;
}
#endregion
//#region 测试出错
//[HttpGet]
//public object GetTest()
//{
// int a = 1,b=0;
// var c = a / b;
// return reJson;
//}
//#endregion
}
}