SVN r1047
SVN-Revision: r1047
This commit is contained in:
@@ -108,7 +108,7 @@ namespace Lskj.Control
|
||||
bool hasEn = false;
|
||||
if (urlParams.Length > 1)
|
||||
{
|
||||
string[] queryParams = urlParams[1].Split('&');
|
||||
string[] queryParams = string.Join("?", urlParams.Skip(1)).Split('&');
|
||||
List<string> qpLS = new List<string>();
|
||||
Hashtable pms = new Hashtable();
|
||||
hasEn = queryParams.Any(str => str.Trim().StartsWith(enKey, StringComparison.OrdinalIgnoreCase));
|
||||
@@ -119,12 +119,32 @@ namespace Lskj.Control
|
||||
{
|
||||
if (hasEn && eqParams[0].ToLower() == enKey)
|
||||
{
|
||||
enVal = eqParams[1];
|
||||
enVal = string.Join("=", eqParams.Skip(1));
|
||||
continue;
|
||||
}
|
||||
if (hasEn || eqParams[0].ToLower() == "username" || eqParams[0].ToLower() == "password")
|
||||
{
|
||||
pms.Add(eqParams[0], eqParams[1]);
|
||||
pms.Add(eqParams[0], string.Join("=", eqParams.Skip(1)));
|
||||
}
|
||||
else
|
||||
|
||||
{
|
||||
qpLS.Add(string.Format("{0}={1}", eqParams[0], HttpUtility.UrlEncode(HttpUtility.UrlDecode(string.Join("=", eqParams.Skip(1)))).Replace("%5c", "/").Replace("%2f", "/").Replace("//", "/")));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
}
|
||||
if (pms.Count > 0)
|
||||
{
|
||||
DateTime dateTime = DateTime.Now.AddDays(1);
|
||||
DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
||||
long timestamp = (dateTime.Ticks - epoch.Ticks) / TimeSpan.TicksPerSecond;
|
||||
pms.Add("exp", timestamp);
|
||||
}
|
||||
return $"{urlParams[0]}?pms={HttpUtility.UrlEncode(hasEn ? Lskj.Web.Core.Util.safety.AESUtil.Encrypt(JSON.Encode(pms), enVal) : Lskj.Web.Core.Util.safety.AESUtil.MobileEncrypt(JSON.Encode(pms)))}&{qpLS.SJoin("&")}";
|
||||
}
|
||||
return url;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user