1
z8018
2025-03-12 17e4c7e3e7b3ef60d9da6de3b2a39a14a53c38a0
WIDESEAWCS_Server/WIDESEAWCS_Core/Authorization/AuthorizationSetup.cs
@@ -5,6 +5,7 @@
using Microsoft.IdentityModel.Tokens;
using System;
using System.Collections.Generic;
using System.IdentityModel.Tokens.Jwt;
using System.Linq;
using System.Security.Claims;
using System.Text;
@@ -58,7 +59,19 @@
                         context.Response.StatusCode = 401;
                         context.Response.WriteAsync(new { message = "授权未通过", status = false, code = 401 }.Serialize());
                         return Task.CompletedTask;
                     }
                     },
                     OnMessageReceived = context =>
                     {
                         if (context.HttpContext.IsSuccessSwagger() == true)
                         {
                              string token = context.HttpContext.GetSuccessSwaggerJwt();
                             if (token.IsNotEmptyOrNull())
                             {
                                 context.Token = token;
                             }
                         }
                         return Task.CompletedTask;
                     },
                 };
             });