1退货包裹保存到服务端
This commit is contained in:
1 parent
c3dc9979d1
commit
77ec460f4d
12 files changed
+296
-460
No files matched your search
@@ -428,5 +428,43 @@ namespace KJD_Web.BLL
|
||||
return "{\"code\":1,\"msg\":\"原密码错误。\"}";
|
||||
}
|
||||
}
|
||||
|
||||
public string return_package_secret_key { get; set; } = "aaMETt2bPe6YHzZ1ojbC+6wOvgtwehqc6A+/Rz+pCUU=";
|
||||
|
||||
public string GetPackageSign(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
var mobile = RegexUtils.GetStringQuery(ref inputData, "mobile")?.Replace("'", "\\'");
|
||||
var password = RegexUtils.GetStringQuery(ref inputData, "password")?.Replace("'", "\\'");
|
||||
var timestamp = RegexUtils.GetStringQuery(ref inputData, "timestamp")?.Replace("'", "\\'");
|
||||
var mallId = RegexUtils.GetStringQuery(ref inputData, "mallId")?.Replace("'", "\\'");
|
||||
var returnPackageNo = RegexUtils.GetStringQuery(ref inputData, "returnPackageNo")?.Replace("'", "\\'");
|
||||
int r2 = RegexUtils.GetStringQuery(ref inputData, "r2").ParseToInt();
|
||||
string c2 = RegexUtils.GetStringQuery(ref inputData, "c2");
|
||||
|
||||
if (EncrypUtil.Encryption(r2) != c2)
|
||||
return "{\"code\":2,\"msg\":\"不合法的输入内容\"}";
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
string sql = "select * from kjd.user where user_name='"
|
||||
+ mobile + "' and password='" + password + "'";
|
||||
|
||||
sql = "select * from kjd.user where user_name='" + mobile + "'";
|
||||
|
||||
var dt = mySql.ExecuteDataTable(sql);
|
||||
mySql.Close();
|
||||
if (dt == null || dt.Rows.Count <=0)
|
||||
{
|
||||
return "{\"code\":1,\"msg\":\"用户不存在\"}";
|
||||
}
|
||||
|
||||
string sign = EncrypUtil.GetMd5(timestamp + return_package_secret_key + mallId + returnPackageNo).ToLower();
|
||||
|
||||
return "{\"code\":200, \"sign\":\"" + sign + "\", \"msg\":\"\"}";
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -66,6 +66,18 @@ namespace KJD_Web
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public void get_package_sign()
|
||||
{
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new UserManage().GetPackageSign(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public void change_password()
|
||||
{
|
||||
|
||||
@@ -19,5 +19,27 @@ namespace KJD_Web.Utils
|
||||
TimeSpan toNow = new TimeSpan(lTime);
|
||||
return dateTimeStart.Add(toNow);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// C#格式时间转换为Unix时间戳(秒)
|
||||
/// </summary>
|
||||
/// <param name="time"></param>
|
||||
/// <returns></returns>
|
||||
public static int DateTimeToTimestampSeconds(DateTime time)
|
||||
{
|
||||
System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1));
|
||||
return (int)(time - startTime).TotalSeconds;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// C#格式时间转换为Unix时间戳(毫秒)
|
||||
/// </summary>
|
||||
/// <param name="time"></param>
|
||||
/// <returns></returns>
|
||||
public static long DateTimeToTimestampMilliseconds(DateTime time)
|
||||
{
|
||||
System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1));
|
||||
return (long)(time - startTime).TotalMilliseconds;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user