From 430f4df6519253ffaf49f2d098ac1df77aa5891e Mon Sep 17 00:00:00 2001
From: 快乐的昕的电脑 <快乐的昕的电脑@DESKTOP-C2BQPQU>
Date: 星期四, 11 九月 2025 14:43:02 +0800
Subject: [PATCH] 销售出库添加一行'制单人'
---
Controllers/BaseController.cs | 31 +++++++++----------------------
1 files changed, 9 insertions(+), 22 deletions(-)
diff --git a/Controllers/BaseController.cs b/Controllers/BaseController.cs
index 3caae53..52ffce2 100644
--- a/Controllers/BaseController.cs
+++ b/Controllers/BaseController.cs
@@ -1,34 +1,21 @@
锘縰sing Microsoft.AspNetCore.Mvc;
-using System;
+using Microsoft.Extensions.DependencyInjection;
public class BaseController : ControllerBase
{
- protected string OrgId
+ private RequestInfo _requestInfo;
+
+ protected RequestInfo RequestInfo
{
get
{
- var orgId = GetOrgIdFromHeader();
- if (string.IsNullOrEmpty(orgId))
+ if (_requestInfo == null)
{
- throw new ArgumentException("璇锋眰缁勭粐ID涓嶅瓨鍦紒璇锋鏌ヨ姹傚ご涓槸鍚﹀寘鍚湁鏁堢殑OrgId銆�");
+ //蹇呭~椤�
+ //_requestInfo.ValidateRequired("OrgId");
+ _requestInfo = HttpContext.RequestServices.GetService<RequestInfo>();
}
- return orgId;
+ return _requestInfo;
}
- }
-
- private string GetOrgIdFromHeader()
- {
- if (HttpContext.Request.Headers.TryGetValue("OrgId", out var orgIdValue))
- {
- return orgIdValue.ToString();
- }
- return null;
- }
-
- // 鍙�夛細鎻愪緵涓�涓畨鍏ㄨ幏鍙朞rgId鐨勬柟娉曪紝涓嶆姏鍑哄紓甯歌�屾槸杩斿洖榛樿鍊兼垨null
- protected bool TryGetOrgId(out string orgId)
- {
- orgId = GetOrgIdFromHeader();
- return !string.IsNullOrEmpty(orgId);
}
}
\ No newline at end of file
--
Gitblit v1.9.3