From 2c458f8ac3515318e46b110a2480ad196b253be9 Mon Sep 17 00:00:00 2001
From: zrg <z1873@LAPTOP-EAVL132E>
Date: 星期五, 27 三月 2026 17:13:45 +0800
Subject: [PATCH] 1
---
WebAPI/Service/JwtAuthorizeAttribute.cs | 21 +++++++++++++++++++--
1 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/WebAPI/Service/JwtAuthorizeAttribute.cs b/WebAPI/Service/JwtAuthorizeAttribute.cs
index ca96e21..816eae0 100644
--- a/WebAPI/Service/JwtAuthorizeAttribute.cs
+++ b/WebAPI/Service/JwtAuthorizeAttribute.cs
@@ -1,4 +1,5 @@
锘縰sing System;
+using System.Linq;
using System.Net;
using System.Net.Http;
using System.Security.Claims;
@@ -53,8 +54,24 @@
// 楠岃瘉鏄惁鎷ユ湁璁块棶妯″潡鐨勬潈闄�
// 鏈変袱绉嶅垽鏂柟寮� 涓�绉嶆槸閫氳繃瑙掕壊鍘诲垽鏂紝涓�绉嶆槸閫氳繃鐢ㄦ埛鍘诲垽鏂� 鐩墠鏆傛椂涓嶅仛鍖哄垎锛屽悗缁彲澧炲姞绯荤粺鍙傛暟鏉ヨ繘琛屽尯鍒�
-
+ //string HModName = actionContext.Request.Headers.GetValues("x-hmodname")?.FirstOrDefault();
+ // if (!string.IsNullOrWhiteSpace(HModName)) // 濡傛灉娌℃湁閰嶇疆妯$粍鍚嶅瓧娈碉紝鍒欓粯璁や负涓嶉渶瑕侀壌鏉�
+ // {
+ // //var operateAttr = actionContext.ActionDescriptor
+ // //.GetCustomAttributes<ModOperateAttribute>()
+ // //.FirstOrDefault();
+ // //if(!string.IsNullOrWhiteSpace(operateAttr.Operate))
+ // //{
+ // //HModName += operateAttr.Operate;
+ // //}
+ // if (!DBUtility.ClsPub.Security_Log(HModName, 1, false, JWTHelper.getUserName(token)))
+ // {
+ // HandleForbidden(actionContext);
+ // return;
+ // }
+ // }
+
// 璁剧疆鐢ㄦ埛
actionContext.RequestContext.Principal = principal;
}
@@ -111,7 +128,7 @@
var response = new HttpResponseMessage(HttpStatusCode.Forbidden);
objjson.code = "0";
objjson.count = 0;
- objjson.Message = "褰撳墠瑙掕壊鏃犳潈闄�";
+ objjson.Message = "鎮ㄦ病鏈夎妯″潡鏉冮檺,璇蜂笌绠$悊鍛樿仈绯伙紒";
response.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(objjson),
System.Text.Encoding.UTF8, "application/json");
context.Response = response;
--
Gitblit v1.9.1