SVN r1076
SVN-Revision: r1076
This commit is contained in:
@@ -458,8 +458,15 @@ namespace Lskj.Util
|
|||||||
//bool outValue = true;
|
//bool outValue = true;
|
||||||
//bool isCond = Boolean.TryParse(cond, out outValue);
|
//bool isCond = Boolean.TryParse(cond, out outValue);
|
||||||
//return string.IsNullOrEmpty(cond) || !isCond ? true : outValue;
|
//return string.IsNullOrEmpty(cond) || !isCond ? true : outValue;
|
||||||
|
try
|
||||||
|
{
|
||||||
return string.IsNullOrEmpty(cond) ? true : Convert.ToBoolean(EvalHelper.Eval(ReplaceEvalCond(cond)));
|
return string.IsNullOrEmpty(cond) ? true : Convert.ToBoolean(EvalHelper.Eval(ReplaceEvalCond(cond)));
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new Exception($"条件判断错误:{cond},{ex.Message}");
|
||||||
|
}
|
||||||
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// <para>说明:说明:替换"{字段}"格式字符串,已替换操作员等信息</para>
|
/// <para>说明:说明:替换"{字段}"格式字符串,已替换操作员等信息</para>
|
||||||
/// <para>创建人:龚宇超</para>
|
/// <para>创建人:龚宇超</para>
|
||||||
@@ -790,4 +797,25 @@ namespace Lskj.Util
|
|||||||
/// <param name="iPersonnelCustomerId">客户标识</param>
|
/// <param name="iPersonnelCustomerId">客户标识</param>
|
||||||
/// <param name="iPersonnelPrivateKey">私钥</param>
|
/// <param name="iPersonnelPrivateKey">私钥</param>
|
||||||
/// <returns>System.String.</returns>
|
/// <returns>System.String.</returns>
|
||||||
public static string ReplaceIPersonnel(string defaultValue, string iPersonnelAllowInformation, stri
|
public static string ReplaceIPersonnel(string defaultValue, string iPersonnelAllowInformation, string iPersonnelCustomerId, string iPersonnelPrivateKey)
|
||||||
|
{
|
||||||
|
if (defaultValue.Contains(_iPersonnelAllowInformation) || defaultValue.Contains(_iPersonnelEncryptedMessage))
|
||||||
|
{
|
||||||
|
//替换许可
|
||||||
|
defaultValue = defaultValue.Replace(_iPersonnelAllowInformation, iPersonnelAllowInformation);
|
||||||
|
//替换加密的签名信息
|
||||||
|
TimeSpan ts = DateTime.Now.ToUniversalTime() - new DateTime(1970, 1, 1);
|
||||||
|
long time = (long)ts.TotalMilliseconds;//当前时间的时间戳
|
||||||
|
string EncryptedMessage = string.Format("company_id={0}&mobile_no={1}×tamp={2}", iPersonnelCustomerId, ERPInfo.Instance.UserLinkPhone, time);
|
||||||
|
string value = Lskj.Util.EncryptByPrivateKey.encryptByPrivateKey(EncryptedMessage, iPersonnelPrivateKey);
|
||||||
|
defaultValue = defaultValue.Replace(_iPersonnelEncryptedMessage, value);
|
||||||
|
|
||||||
|
}
|
||||||
|
return defaultValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user