|
@@ -36,7 +36,18 @@ namespace Middleware
|
|
|
if(context.HttpContext.Request.Method.ToLower() == "get")
|
|
|
{
|
|
|
content = context.HttpContext.GetQueryString();
|
|
|
- content = content.Substring(content.IndexOf("=") + 1);
|
|
|
+ content = content.Substring(content.IndexOf("?") + 1);
|
|
|
+ if(!string.IsNullOrEmpty(content))
|
|
|
+ {
|
|
|
+ string jsonString = "";
|
|
|
+ string[] dataList = content.Split('&');
|
|
|
+ foreach(string sub in dataList)
|
|
|
+ {
|
|
|
+ string[] item = sub.Split('=');
|
|
|
+ jsonString += "\"" + item[0] + "\":\"" + item[1] + "\",";
|
|
|
+ }
|
|
|
+ content = "{" + jsonString.TrimEnd(',') + "}";
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -104,20 +115,23 @@ namespace Middleware
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- string ParamName = context.ActionArguments.Keys.First();
|
|
|
- object ParamValue = context.ActionArguments.Values.First();
|
|
|
- // ParamValue = DesDecrypt(ParamValue.ToString());
|
|
|
- if(ParamValue.GetType() == typeof(int))
|
|
|
- {
|
|
|
- ParamValue = (int)ParamValue;
|
|
|
- }
|
|
|
- if(context.ActionArguments.ContainsKey(ParamName))
|
|
|
- {
|
|
|
- context.ActionArguments[ParamName] = ParamValue;
|
|
|
- }
|
|
|
- else
|
|
|
+ if(context.ActionDescriptor.Parameters.Count > 0)
|
|
|
{
|
|
|
- context.ActionArguments.Add(ParamName, ParamValue);
|
|
|
+ string ParamName = context.ActionArguments.Keys.First();
|
|
|
+ object ParamValue = context.ActionArguments.Values.First();
|
|
|
+ // ParamValue = DesDecrypt(ParamValue.ToString());
|
|
|
+ if(ParamValue.GetType() == typeof(int))
|
|
|
+ {
|
|
|
+ ParamValue = (int)ParamValue;
|
|
|
+ }
|
|
|
+ if(context.ActionArguments.ContainsKey(ParamName))
|
|
|
+ {
|
|
|
+ context.ActionArguments[ParamName] = ParamValue;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ context.ActionArguments.Add(ParamName, ParamValue);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
string msg = string.Empty;
|