refactor(tenpayv3): 优化反射性能

This commit is contained in:
Fu Diwei
2022-06-14 10:23:28 +08:00
parent 8fa58b98a1
commit a6a4b28baf
3 changed files with 25 additions and 5 deletions

View File

@@ -23,7 +23,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
try
{
bool requireEncrypt = request.GetType().GetCustomAttributes<WechatTenpaySensitiveAttribute>(inherit: true).Any();
bool requireEncrypt = Attribute.IsDefined(request.GetType(), typeof(WechatTenpaySensitiveAttribute));
if (requireEncrypt)
{
// 遍历并加密被标记为敏感数据的字段

View File

@@ -55,7 +55,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3
return response;
}
bool requireDecrypt = response.GetType().GetCustomAttributes<WechatTenpaySensitiveAttribute>(inherit: true).Any();
bool requireDecrypt = Attribute.IsDefined(response.GetType(), typeof(WechatTenpaySensitiveAttribute));
if (requireDecrypt)
{
// 遍历并解密被标记为敏感数据的字段