LEIYI hace 2 meses
padre
commit
05a1c77b72

+ 3 - 3
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -5628,7 +5628,7 @@ FROM
         }
 
         /// <summary>
-        /// 团组模块 - 出入境费用 - File downlaod
+        /// 团组模块 - 出入境费用 - File download
         /// </summary>
         /// <param name="dto"></param>
         /// <returns></returns>
@@ -6110,12 +6110,12 @@ FROM
                             {
                                 string ext = string.IsNullOrEmpty(userInfo.ExtensionNumber) ? "-" : userInfo.ExtensionNumber;
                                 //userLabel = $"联系人:{userInfo.Name} 职位:{userInfo.Job}\r\n座机/分机号:{ext} 手机号:{userInfo.Tel} 公司邮箱:{userInfo.Email}";
-                                userLabel = $"Contact:{userInfo.Name} Job:{userInfo.Job}\r\n Phone:{userInfo.Tel} Email:{userInfo.Email}";
+                                userLabel = $"联系人:{userInfo.Name} 职 位:{userInfo.Job} 手机号:{userInfo.Tel}\r\n公司邮箱:{userInfo.Email}";
                             }
                         }
 
                         //设置页脚
-                        //GeneralMethod.AsposeWordSetFooter(builder, userLabel, "Arial", 10);
+                        //GeneralMethod.AsposeWordSetFooter(builder, userLabel, "华文仿宋", 10);
 
                         #endregion
 

+ 50 - 0
OASystem/OASystem.Api/Middlewares/FixedPromptMiddleware.cs

@@ -0,0 +1,50 @@
+using NetTaste;
+using System.Text.Encodings.Web;
+using System.Text.Json;
+using System.Text.Unicode;
+
+namespace OASystem.API.Middlewares
+{
+    /// <summary>
+    /// api所有入口固定提示
+    /// </summary>
+    public class FixedPromptMiddleware
+    {
+        private readonly RequestDelegate _next;
+
+        public FixedPromptMiddleware(RequestDelegate next)
+        {
+            _next = next;
+        }
+
+        public async Task InvokeAsync(HttpContext context)
+        {
+            // 检查是否为 API 请求
+            if (context.Request.Path.StartsWithSegments("/api"))
+            {
+                // 设置响应内容类型
+                context.Response.ContentType = "text/plain";
+
+                //固定提示格式
+                var response = new JsonView()
+                {
+                    Code = 204,
+                    Msg = "紧急通知:因明年接入AI接口,需服务器框架升级及数据库数据备份,OA系统pc端及手机端将暂停使用,我们尽量在48小时内升级完成并恢复使用。"
+
+                };
+
+                // 写入固定的提示信息
+                await context.Response.WriteAsync(System.Text.Json.JsonSerializer.Serialize(response,new JsonSerializerOptions
+                {
+                    Encoder = JavaScriptEncoder.Create(UnicodeRanges.All)
+                }));
+
+                // 不再调用后续中间件
+                return;
+            }
+
+            // 调用后续中间件
+            await _next(context);
+        }
+    }
+}

+ 8 - 0
OASystem/OASystem.Api/Program.cs

@@ -360,6 +360,7 @@ builder.Services.TryAddSingleton(typeof(CommonService));
 #endregion
 
 var app = builder.Build();
+
 AutofacIocManager.Instance.Container = app.UseHostFiltering().ApplicationServices.GetAutofacRoot();//AutofacIocManager
 
 // Configure the HTTP request pipeline.
@@ -367,11 +368,15 @@ if (!app.Environment.IsDevelopment())
 {
     app.UseExceptionHandler("/Home/Error");
 }
+
 app.UseStaticFiles();
 
+app.UseMiddleware<FixedPromptMiddleware>();
 app.UseMiddleware<ExceptionHandlingMiddleware>();
 
 app.UseRouting();
+
+
 app.UseCors("Cors");  //Cors
 
 app.UseAuthentication(); // ÈÏÖ¤
@@ -430,6 +435,9 @@ app.MapHub<ChatHub>("/ChatHub", options =>
 #endregion
 
 
+
+
+
 app.MapControllerRoute(
     name: "default",
     pattern: "{controller=Home}/{action=Index}/{id?}");