代码优化

master
xiaochanghai 1 year ago
parent 114af793a4
commit 129908badf
  1. 149
      Model/Tiobon.Web.pdm
  2. 2
      Tiobon.Core.Api/Controllers/CommonController.cs
  3. 3
      Tiobon.Core.Api/Controllers/Ghre/Ghre_CourseClassController.cs
  4. 2
      Tiobon.Core.Api/Filter/GlobalActionFilter.cs
  5. 1
      Tiobon.Core.Common/Attribute/QueryFilter.cs
  6. 49
      Tiobon.Core.Common/HttpContextUser/AspNetUser.cs
  7. 12
      Tiobon.Core.Common/HttpContextUser/IUser.cs
  8. 13
      Tiobon.Core.Extensions/Authorizations/Policys/ApiResponseHandler.cs
  9. 22
      Tiobon.Core.Extensions/Middlewares/JwtTokenAuthMiddleware.cs
  10. 13
      Tiobon.Core.Extensions/ServiceExtensions/Authentication_JWTSetup.cs
  11. 8
      Tiobon.Core.Services/CommonServices.cs

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<?PowerDesigner AppLocale="UTF16" ID="{C294868A-C3F3-41AD-98CC-78B6D4E0CC40}" Label="" LastModificationDate="1715153446" Name="一优开发平台" Objects="6473" Symbols="275" Target="Microsoft SQL Server 2008" Type="{CDE44E21-9669-11D1-9914-006097355D9B}" signature="PDM_DATA_MODEL_XML" version="15.0.0.2613"?>
<?PowerDesigner AppLocale="UTF16" ID="{C294868A-C3F3-41AD-98CC-78B6D4E0CC40}" Label="" LastModificationDate="1715421020" Name="一优开发平台" Objects="6506" Symbols="276" Target="Microsoft SQL Server 2008" Type="{CDE44E21-9669-11D1-9914-006097355D9B}" signature="PDM_DATA_MODEL_XML" version="15.0.0.2613"?>
<!-- do not edit this file -->
<Model xmlns:a="attribute" xmlns:c="collection" xmlns:o="object">
@ -8555,15 +8555,13 @@ Shadow=0</a:DisplayPreferences>
<o:ReferenceSymbol Id="o105">
<a:CreationDate>1612889255</a:CreationDate>
<a:ModificationDate>1612889255</a:ModificationDate>
<a:Rect>((-20242,-4369), (-14842,3431))</a:Rect>
<a:Rect>((-17767,-4369), (-17317,3431))</a:Rect>
<a:ListOfPoints>((-17542,-4369),(-17542,3431))</a:ListOfPoints>
<a:CornerStyle>2</a:CornerStyle>
<a:ArrowStyle>1</a:ArrowStyle>
<a:LineColor>16711680</a:LineColor>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>CENTER 0 宋体,9,N
SOURCE 0 宋体,9,N
DESTINATION 0 宋体,9,N</a:FontList>
<a:FontList> 0 Arial,8,N</a:FontList>
<c:SourceSymbol>
<o:TableSymbol Ref="o106"/>
</c:SourceSymbol>
@ -8577,15 +8575,13 @@ DESTINATION 0 宋体,9,N</a:FontList>
<o:ReferenceSymbol Id="o109">
<a:CreationDate>1612889255</a:CreationDate>
<a:ModificationDate>1612889255</a:ModificationDate>
<a:Rect>((-11673,-4294), (-6273,3506))</a:Rect>
<a:Rect>((-9198,-4294), (-8748,3506))</a:Rect>
<a:ListOfPoints>((-8973,-4294),(-8973,3506))</a:ListOfPoints>
<a:CornerStyle>2</a:CornerStyle>
<a:ArrowStyle>1</a:ArrowStyle>
<a:LineColor>16711680</a:LineColor>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>CENTER 0 宋体,9,N
SOURCE 0 宋体,9,N
DESTINATION 0 宋体,9,N</a:FontList>
<a:FontList> 0 Arial,8,N</a:FontList>
<c:SourceSymbol>
<o:TableSymbol Ref="o110"/>
</c:SourceSymbol>
@ -8599,15 +8595,13 @@ DESTINATION 0 宋体,9,N</a:FontList>
<o:ReferenceSymbol Id="o113">
<a:CreationDate>1612889255</a:CreationDate>
<a:ModificationDate>1612889255</a:ModificationDate>
<a:Rect>((-2651,-4294), (2749,3506))</a:Rect>
<a:Rect>((-176,-4294), (274,3506))</a:Rect>
<a:ListOfPoints>((49,-4294),(49,3506))</a:ListOfPoints>
<a:CornerStyle>2</a:CornerStyle>
<a:ArrowStyle>1</a:ArrowStyle>
<a:LineColor>16711680</a:LineColor>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>CENTER 0 宋体,9,N
SOURCE 0 宋体,9,N
DESTINATION 0 宋体,9,N</a:FontList>
<a:FontList> 0 Arial,8,N</a:FontList>
<c:SourceSymbol>
<o:TableSymbol Ref="o114"/>
</c:SourceSymbol>
@ -8621,15 +8615,13 @@ DESTINATION 0 宋体,9,N</a:FontList>
<o:ReferenceSymbol Id="o117">
<a:CreationDate>1612889255</a:CreationDate>
<a:ModificationDate>1612889255</a:ModificationDate>
<a:Rect>((5524,-4068), (10924,3957))</a:Rect>
<a:Rect>((7999,-4068), (8449,3957))</a:Rect>
<a:ListOfPoints>((8224,-4068),(8224,3957))</a:ListOfPoints>
<a:CornerStyle>2</a:CornerStyle>
<a:ArrowStyle>1</a:ArrowStyle>
<a:LineColor>16711680</a:LineColor>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>CENTER 0 宋体,9,N
SOURCE 0 宋体,9,N
DESTINATION 0 宋体,9,N</a:FontList>
<a:FontList> 0 Arial,8,N</a:FontList>
<c:SourceSymbol>
<o:TableSymbol Ref="o118"/>
</c:SourceSymbol>
@ -8643,15 +8635,13 @@ DESTINATION 0 宋体,9,N</a:FontList>
<o:ReferenceSymbol Id="o121">
<a:CreationDate>1612889255</a:CreationDate>
<a:ModificationDate>1612889255</a:ModificationDate>
<a:Rect>((14899,-4322), (20299,3478))</a:Rect>
<a:Rect>((17374,-4322), (17824,3478))</a:Rect>
<a:ListOfPoints>((17599,-4322),(17599,3478))</a:ListOfPoints>
<a:CornerStyle>2</a:CornerStyle>
<a:ArrowStyle>1</a:ArrowStyle>
<a:LineColor>16711680</a:LineColor>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>CENTER 0 宋体,9,N
SOURCE 0 宋体,9,N
DESTINATION 0 宋体,9,N</a:FontList>
<a:FontList> 0 Arial,8,N</a:FontList>
<c:SourceSymbol>
<o:TableSymbol Ref="o122"/>
</c:SourceSymbol>
@ -8665,15 +8655,13 @@ DESTINATION 0 宋体,9,N</a:FontList>
<o:ReferenceSymbol Id="o125">
<a:CreationDate>1631110453</a:CreationDate>
<a:ModificationDate>1631713388</a:ModificationDate>
<a:Rect>((-20566,-19163), (-15166,-13538))</a:Rect>
<a:Rect>((-18091,-19163), (-17641,-13538))</a:Rect>
<a:ListOfPoints>((-17866,-19163),(-17866,-13538))</a:ListOfPoints>
<a:CornerStyle>2</a:CornerStyle>
<a:ArrowStyle>1</a:ArrowStyle>
<a:LineColor>16711680</a:LineColor>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>CENTER 0 宋体,9,N
SOURCE 0 宋体,9,N
DESTINATION 0 宋体,9,N</a:FontList>
<a:FontList> 0 Arial,8,N</a:FontList>
<c:SourceSymbol>
<o:TableSymbol Ref="o126"/>
</c:SourceSymbol>
@ -8687,15 +8675,13 @@ DESTINATION 0 宋体,9,N</a:FontList>
<o:ReferenceSymbol Id="o129">
<a:CreationDate>1637073068</a:CreationDate>
<a:ModificationDate>1637073941</a:ModificationDate>
<a:Rect>((-11774,4837), (-6374,10987))</a:Rect>
<a:Rect>((-9299,4837), (-8849,10987))</a:Rect>
<a:ListOfPoints>((-9074,10987),(-9074,4837))</a:ListOfPoints>
<a:CornerStyle>2</a:CornerStyle>
<a:ArrowStyle>1</a:ArrowStyle>
<a:LineColor>16711680</a:LineColor>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>CENTER 0 宋体,9,N
SOURCE 0 宋体,9,N
DESTINATION 0 宋体,9,N</a:FontList>
<a:FontList> 0 Arial,8,N</a:FontList>
<c:SourceSymbol>
<o:TableSymbol Ref="o130"/>
</c:SourceSymbol>
@ -8709,15 +8695,13 @@ DESTINATION 0 宋体,9,N</a:FontList>
<o:ReferenceSymbol Id="o132">
<a:CreationDate>1637151949</a:CreationDate>
<a:ModificationDate>1637151949</a:ModificationDate>
<a:Rect>((-11925,-19688), (-6525,-13538))</a:Rect>
<a:Rect>((-9450,-19688), (-9000,-13538))</a:Rect>
<a:ListOfPoints>((-9225,-19688),(-9225,-13538))</a:ListOfPoints>
<a:CornerStyle>2</a:CornerStyle>
<a:ArrowStyle>1</a:ArrowStyle>
<a:LineColor>16711680</a:LineColor>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>CENTER 0 宋体,9,N
SOURCE 0 宋体,9,N
DESTINATION 0 宋体,9,N</a:FontList>
<a:FontList> 0 Arial,8,N</a:FontList>
<c:SourceSymbol>
<o:TableSymbol Ref="o133"/>
</c:SourceSymbol>
@ -8738,7 +8722,6 @@ DESTINATION 0 宋体,9,N</a:FontList>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>STRN 0 Arial Unicode MS,8,N
DISPNAME 0 宋体,9,N
OWNRDISPNAME 0 宋体,9,N
Columns 0 宋体,9,N
TablePkColumns 0 宋体,9,N
TableFkColumns 0 宋体,9,N
@ -8761,7 +8744,6 @@ LABL 0 Arial Unicode MS,8,N</a:FontList>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>STRN 0 Arial Unicode MS,8,N
DISPNAME 0 宋体,9,N
OWNRDISPNAME 0 宋体,9,N
Columns 0 宋体,9,N
TablePkColumns 0 宋体,9,N
TableFkColumns 0 宋体,9,N
@ -8784,7 +8766,6 @@ LABL 0 Arial Unicode MS,8,N</a:FontList>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>STRN 0 Arial Unicode MS,8,N
DISPNAME 0 宋体,9,N
OWNRDISPNAME 0 宋体,9,N
Columns 0 宋体,9,N
TablePkColumns 0 宋体,9,N
TableFkColumns 0 宋体,9,N
@ -8807,7 +8788,6 @@ LABL 0 Arial Unicode MS,8,N</a:FontList>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>STRN 0 Arial Unicode MS,8,N
DISPNAME 0 宋体,9,N
OWNRDISPNAME 0 宋体,9,N
Columns 0 宋体,9,N
TablePkColumns 0 宋体,9,N
TableFkColumns 0 宋体,9,N
@ -8830,7 +8810,6 @@ LABL 0 Arial Unicode MS,8,N</a:FontList>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>STRN 0 Arial Unicode MS,8,N
DISPNAME 0 宋体,9,N
OWNRDISPNAME 0 宋体,9,N
Columns 0 宋体,9,N
TablePkColumns 0 宋体,9,N
TableFkColumns 0 宋体,9,N
@ -8853,7 +8832,6 @@ LABL 0 Arial Unicode MS,8,N</a:FontList>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>STRN 0 Arial Unicode MS,8,N
DISPNAME 0 宋体,9,N
OWNRDISPNAME 0 宋体,9,N
Columns 0 宋体,9,N
TablePkColumns 0 宋体,9,N
TableFkColumns 0 宋体,9,N
@ -8876,7 +8854,6 @@ LABL 0 Arial Unicode MS,8,N</a:FontList>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>STRN 0 Arial Unicode MS,8,N
DISPNAME 0 宋体,9,N
OWNRDISPNAME 0 宋体,9,N
Columns 0 宋体,9,N
TablePkColumns 0 宋体,9,N
TableFkColumns 0 宋体,9,N
@ -8899,7 +8876,6 @@ LABL 0 Arial Unicode MS,8,N</a:FontList>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>STRN 0 Arial Unicode MS,8,N
DISPNAME 0 宋体,9,N
OWNRDISPNAME 0 宋体,9,N
Columns 0 宋体,9,N
TablePkColumns 0 宋体,9,N
TableFkColumns 0 宋体,9,N
@ -8922,7 +8898,6 @@ LABL 0 Arial Unicode MS,8,N</a:FontList>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>STRN 0 Arial Unicode MS,8,N
DISPNAME 0 宋体,9,N
OWNRDISPNAME 0 宋体,9,N
Columns 0 宋体,9,N
TablePkColumns 0 宋体,9,N
TableFkColumns 0 宋体,9,N
@ -8945,7 +8920,6 @@ LABL 0 Arial Unicode MS,8,N</a:FontList>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>STRN 0 Arial Unicode MS,8,N
DISPNAME 0 宋体,9,N
OWNRDISPNAME 0 宋体,9,N
Columns 0 宋体,9,N
TablePkColumns 0 宋体,9,N
TableFkColumns 0 宋体,9,N
@ -8968,7 +8942,6 @@ LABL 0 Arial Unicode MS,8,N</a:FontList>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>STRN 0 Arial Unicode MS,8,N
DISPNAME 0 宋体,9,N
OWNRDISPNAME 0 宋体,9,N
Columns 0 宋体,9,N
TablePkColumns 0 宋体,9,N
TableFkColumns 0 宋体,9,N
@ -8991,7 +8964,6 @@ LABL 0 Arial Unicode MS,8,N</a:FontList>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>STRN 0 Arial Unicode MS,8,N
DISPNAME 0 宋体,9,N
OWNRDISPNAME 0 宋体,9,N
Columns 0 宋体,9,N
TablePkColumns 0 宋体,9,N
TableFkColumns 0 宋体,9,N
@ -9014,7 +8986,6 @@ LABL 0 Arial Unicode MS,8,N</a:FontList>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>STRN 0 Arial Unicode MS,8,N
DISPNAME 0 宋体,9,N
OWNRDISPNAME 0 宋体,9,N
Columns 0 宋体,9,N
TablePkColumns 0 宋体,9,N
TableFkColumns 0 宋体,9,N
@ -9037,7 +9008,6 @@ LABL 0 Arial Unicode MS,8,N</a:FontList>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>STRN 0 Arial Unicode MS,8,N
DISPNAME 0 宋体,9,N
OWNRDISPNAME 0 宋体,9,N
Columns 0 宋体,9,N
TablePkColumns 0 宋体,9,N
TableFkColumns 0 宋体,9,N
@ -9060,7 +9030,6 @@ LABL 0 Arial Unicode MS,8,N</a:FontList>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>STRN 0 Arial Unicode MS,8,N
DISPNAME 0 宋体,9,N
OWNRDISPNAME 0 宋体,9,N
Columns 0 宋体,9,N
TablePkColumns 0 宋体,9,N
TableFkColumns 0 宋体,9,N
@ -9530,15 +9499,13 @@ Shadow=0</a:DisplayPreferences>
<o:ReferenceSymbol Id="o152">
<a:CreationDate>1612889277</a:CreationDate>
<a:ModificationDate>1613576461</a:ModificationDate>
<a:Rect>((-14101,-3539), (-8701,4111))</a:Rect>
<a:Rect>((-11626,-3539), (-11176,4111))</a:Rect>
<a:ListOfPoints>((-11401,-3539),(-11401,4111))</a:ListOfPoints>
<a:CornerStyle>2</a:CornerStyle>
<a:ArrowStyle>1</a:ArrowStyle>
<a:LineColor>16711680</a:LineColor>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>CENTER 0 宋体,9,N
SOURCE 0 宋体,9,N
DESTINATION 0 宋体,9,N</a:FontList>
<a:FontList> 0 Arial,8,N</a:FontList>
<c:SourceSymbol>
<o:TableSymbol Ref="o153"/>
</c:SourceSymbol>
@ -9552,15 +9519,13 @@ DESTINATION 0 宋体,9,N</a:FontList>
<o:ReferenceSymbol Id="o156">
<a:CreationDate>1612889277</a:CreationDate>
<a:ModificationDate>1613576461</a:ModificationDate>
<a:Rect>((-5251,-4424), (149,3901))</a:Rect>
<a:Rect>((-2776,-4424), (-2326,3901))</a:Rect>
<a:ListOfPoints>((-2551,-4424),(-2551,3901))</a:ListOfPoints>
<a:CornerStyle>2</a:CornerStyle>
<a:ArrowStyle>1</a:ArrowStyle>
<a:LineColor>16711680</a:LineColor>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>CENTER 0 宋体,9,N
SOURCE 0 宋体,9,N
DESTINATION 0 宋体,9,N</a:FontList>
<a:FontList> 0 Arial,8,N</a:FontList>
<c:SourceSymbol>
<o:TableSymbol Ref="o157"/>
</c:SourceSymbol>
@ -9574,15 +9539,13 @@ DESTINATION 0 宋体,9,N</a:FontList>
<o:ReferenceSymbol Id="o160">
<a:CreationDate>1613576414</a:CreationDate>
<a:ModificationDate>1613576461</a:ModificationDate>
<a:Rect>((4725,-4050), (10125,3300))</a:Rect>
<a:Rect>((7200,-4050), (7650,3300))</a:Rect>
<a:ListOfPoints>((7425,-4050),(7425,3300))</a:ListOfPoints>
<a:CornerStyle>2</a:CornerStyle>
<a:ArrowStyle>1</a:ArrowStyle>
<a:LineColor>16711680</a:LineColor>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>CENTER 0 宋体,9,N
SOURCE 0 宋体,9,N
DESTINATION 0 宋体,9,N</a:FontList>
<a:FontList> 0 Arial,8,N</a:FontList>
<c:SourceSymbol>
<o:TableSymbol Ref="o161"/>
</c:SourceSymbol>
@ -9596,15 +9559,13 @@ DESTINATION 0 宋体,9,N</a:FontList>
<o:ReferenceSymbol Id="o164">
<a:CreationDate>1613577000</a:CreationDate>
<a:ModificationDate>1613577004</a:ModificationDate>
<a:Rect>((14288,-4125), (19688,3900))</a:Rect>
<a:Rect>((16763,-4125), (17213,3900))</a:Rect>
<a:ListOfPoints>((16988,-4125),(16988,3900))</a:ListOfPoints>
<a:CornerStyle>2</a:CornerStyle>
<a:ArrowStyle>1</a:ArrowStyle>
<a:LineColor>16711680</a:LineColor>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>CENTER 0 宋体,9,N
SOURCE 0 宋体,9,N
DESTINATION 0 宋体,9,N</a:FontList>
<a:FontList> 0 Arial,8,N</a:FontList>
<c:SourceSymbol>
<o:TableSymbol Ref="o165"/>
</c:SourceSymbol>
@ -9618,15 +9579,13 @@ DESTINATION 0 宋体,9,N</a:FontList>
<o:ReferenceSymbol Id="o168">
<a:CreationDate>1613577204</a:CreationDate>
<a:ModificationDate>1613869749</a:ModificationDate>
<a:Rect>((22575,-4162), (27975,3563))</a:Rect>
<a:Rect>((23888,-4162), (26663,3563))</a:Rect>
<a:ListOfPoints>((23888,-4162),(23888,-300),(26663,-300),(26663,3563))</a:ListOfPoints>
<a:CornerStyle>2</a:CornerStyle>
<a:ArrowStyle>1</a:ArrowStyle>
<a:LineColor>16711680</a:LineColor>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>CENTER 0 宋体,9,N
SOURCE 0 宋体,9,N
DESTINATION 0 宋体,9,N</a:FontList>
<a:FontList> 0 Arial,8,N</a:FontList>
<c:SourceSymbol>
<o:TableSymbol Ref="o169"/>
</c:SourceSymbol>
@ -9640,15 +9599,13 @@ DESTINATION 0 宋体,9,N</a:FontList>
<o:ReferenceSymbol Id="o172">
<a:CreationDate>1618220270</a:CreationDate>
<a:ModificationDate>1618220270</a:ModificationDate>
<a:Rect>((-23212,-3599), (-17812,3900))</a:Rect>
<a:Rect>((-20737,-3599), (-20287,3900))</a:Rect>
<a:ListOfPoints>((-20512,-3599),(-20512,3900))</a:ListOfPoints>
<a:CornerStyle>2</a:CornerStyle>
<a:ArrowStyle>1</a:ArrowStyle>
<a:LineColor>16711680</a:LineColor>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>CENTER 0 宋体,9,N
SOURCE 0 宋体,9,N
DESTINATION 0 宋体,9,N</a:FontList>
<a:FontList> 0 Arial,8,N</a:FontList>
<c:SourceSymbol>
<o:TableSymbol Ref="o173"/>
</c:SourceSymbol>
@ -9662,15 +9619,13 @@ DESTINATION 0 宋体,9,N</a:FontList>
<o:ReferenceSymbol Id="o176">
<a:CreationDate>1618996307</a:CreationDate>
<a:ModificationDate>1619014022</a:ModificationDate>
<a:Rect>((-22612,-17687), (-17212,-10612))</a:Rect>
<a:Rect>((-20137,-17687), (-19687,-10612))</a:Rect>
<a:ListOfPoints>((-19912,-17687),(-19912,-10612))</a:ListOfPoints>
<a:CornerStyle>2</a:CornerStyle>
<a:ArrowStyle>1</a:ArrowStyle>
<a:LineColor>16711680</a:LineColor>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>CENTER 0 宋体,9,N
SOURCE 0 宋体,9,N
DESTINATION 0 宋体,9,N</a:FontList>
<a:FontList> 0 Arial,8,N</a:FontList>
<c:SourceSymbol>
<o:TableSymbol Ref="o177"/>
</c:SourceSymbol>
@ -9691,7 +9646,6 @@ DESTINATION 0 宋体,9,N</a:FontList>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>STRN 0 Arial Unicode MS,8,N
DISPNAME 0 宋体,9,N
OWNRDISPNAME 0 宋体,9,N
Columns 0 宋体,9,N
TablePkColumns 0 宋体,9,N
TableFkColumns 0 宋体,9,N
@ -9714,7 +9668,6 @@ LABL 0 Arial Unicode MS,8,N</a:FontList>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>STRN 0 Arial Unicode MS,8,N
DISPNAME 0 宋体,9,N
OWNRDISPNAME 0 宋体,9,N
Columns 0 宋体,9,N
TablePkColumns 0 宋体,9,N
TableFkColumns 0 宋体,9,N
@ -9737,7 +9690,6 @@ LABL 0 Arial Unicode MS,8,N</a:FontList>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>STRN 0 Arial Unicode MS,8,N
DISPNAME 0 宋体,9,N
OWNRDISPNAME 0 宋体,9,N
Columns 0 宋体,9,N
TablePkColumns 0 宋体,9,N
TableFkColumns 0 宋体,9,N
@ -9760,7 +9712,6 @@ LABL 0 Arial Unicode MS,8,N</a:FontList>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>STRN 0 Arial Unicode MS,8,N
DISPNAME 0 宋体,9,N
OWNRDISPNAME 0 宋体,9,N
Columns 0 宋体,9,N
TablePkColumns 0 宋体,9,N
TableFkColumns 0 宋体,9,N
@ -9783,7 +9734,6 @@ LABL 0 Arial Unicode MS,8,N</a:FontList>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>STRN 0 Arial Unicode MS,8,N
DISPNAME 0 宋体,9,N
OWNRDISPNAME 0 宋体,9,N
Columns 0 宋体,9,N
TablePkColumns 0 宋体,9,N
TableFkColumns 0 宋体,9,N
@ -9806,7 +9756,6 @@ LABL 0 Arial Unicode MS,8,N</a:FontList>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>STRN 0 Arial Unicode MS,8,N
DISPNAME 0 宋体,9,N
OWNRDISPNAME 0 宋体,9,N
Columns 0 宋体,9,N
TablePkColumns 0 宋体,9,N
TableFkColumns 0 宋体,9,N
@ -9829,7 +9778,6 @@ LABL 0 Arial Unicode MS,8,N</a:FontList>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>STRN 0 Arial Unicode MS,8,N
DISPNAME 0 宋体,9,N
OWNRDISPNAME 0 宋体,9,N
Columns 0 宋体,9,N
TablePkColumns 0 宋体,9,N
TableFkColumns 0 宋体,9,N
@ -9852,7 +9800,6 @@ LABL 0 Arial Unicode MS,8,N</a:FontList>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>STRN 0 Arial Unicode MS,8,N
DISPNAME 0 宋体,9,N
OWNRDISPNAME 0 宋体,9,N
Columns 0 宋体,9,N
TablePkColumns 0 宋体,9,N
TableFkColumns 0 宋体,9,N
@ -9875,7 +9822,6 @@ LABL 0 Arial Unicode MS,8,N</a:FontList>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>STRN 0 Arial Unicode MS,8,N
DISPNAME 0 宋体,9,N
OWNRDISPNAME 0 宋体,9,N
Columns 0 宋体,9,N
TablePkColumns 0 宋体,9,N
TableFkColumns 0 宋体,9,N
@ -9898,7 +9844,6 @@ LABL 0 Arial Unicode MS,8,N</a:FontList>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>STRN 0 Arial Unicode MS,8,N
DISPNAME 0 宋体,9,N
OWNRDISPNAME 0 宋体,9,N
Columns 0 宋体,9,N
TablePkColumns 0 宋体,9,N
TableFkColumns 0 宋体,9,N
@ -9921,7 +9866,6 @@ LABL 0 Arial Unicode MS,8,N</a:FontList>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>STRN 0 Arial Unicode MS,8,N
DISPNAME 0 宋体,9,N
OWNRDISPNAME 0 宋体,9,N
Columns 0 宋体,9,N
TablePkColumns 0 宋体,9,N
TableFkColumns 0 宋体,9,N
@ -9944,7 +9888,6 @@ LABL 0 Arial Unicode MS,8,N</a:FontList>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>STRN 0 Arial Unicode MS,8,N
DISPNAME 0 宋体,9,N
OWNRDISPNAME 0 宋体,9,N
Columns 0 宋体,9,N
TablePkColumns 0 宋体,9,N
TableFkColumns 0 宋体,9,N
@ -9967,7 +9910,6 @@ LABL 0 Arial Unicode MS,8,N</a:FontList>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>STRN 0 Arial Unicode MS,8,N
DISPNAME 0 宋体,9,N
OWNRDISPNAME 0 宋体,9,N
Columns 0 宋体,9,N
TablePkColumns 0 宋体,9,N
TableFkColumns 0 宋体,9,N
@ -9990,7 +9932,6 @@ LABL 0 Arial Unicode MS,8,N</a:FontList>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>STRN 0 Arial Unicode MS,8,N
DISPNAME 0 宋体,9,N
OWNRDISPNAME 0 宋体,9,N
Columns 0 宋体,9,N
TablePkColumns 0 宋体,9,N
TableFkColumns 0 宋体,9,N
@ -16467,15 +16408,13 @@ Shadow=0</a:DisplayPreferences>
<o:ReferenceSymbol Id="o458">
<a:CreationDate>1630078689</a:CreationDate>
<a:ModificationDate>1630078691</a:ModificationDate>
<a:Rect>((-19875,5199), (-14475,11574))</a:Rect>
<a:Rect>((-17400,5199), (-16950,11574))</a:Rect>
<a:ListOfPoints>((-17175,5199),(-17175,11574))</a:ListOfPoints>
<a:CornerStyle>2</a:CornerStyle>
<a:ArrowStyle>1</a:ArrowStyle>
<a:LineColor>16711680</a:LineColor>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>CENTER 0 宋体,9,N
SOURCE 0 宋体,9,N
DESTINATION 0 宋体,9,N</a:FontList>
<a:FontList> 0 Arial,8,N</a:FontList>
<c:SourceSymbol>
<o:TableSymbol Ref="o459"/>
</c:SourceSymbol>
@ -16496,7 +16435,6 @@ DESTINATION 0 宋体,9,N</a:FontList>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>STRN 0 Arial Unicode MS,8,N
DISPNAME 0 宋体,9,N
OWNRDISPNAME 0 宋体,9,N
Columns 0 宋体,9,N
TablePkColumns 0 宋体,9,N
TableFkColumns 0 宋体,9,N
@ -16519,7 +16457,6 @@ LABL 0 Arial Unicode MS,8,N</a:FontList>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>STRN 0 Arial Unicode MS,8,N
DISPNAME 0 宋体,9,N
OWNRDISPNAME 0 宋体,9,N
Columns 0 宋体,9,N
TablePkColumns 0 宋体,9,N
TableFkColumns 0 宋体,9,N
@ -16989,15 +16926,13 @@ Shadow=0</a:DisplayPreferences>
<o:ReferenceSymbol Id="o465">
<a:CreationDate>1656491722</a:CreationDate>
<a:ModificationDate>1656491722</a:ModificationDate>
<a:Rect>((-21449,3675), (-16049,10500))</a:Rect>
<a:Rect>((-18974,3675), (-18524,10500))</a:Rect>
<a:ListOfPoints>((-18749,3675),(-18749,10500))</a:ListOfPoints>
<a:CornerStyle>2</a:CornerStyle>
<a:ArrowStyle>1</a:ArrowStyle>
<a:LineColor>16711680</a:LineColor>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>CENTER 0 宋体,9,N
SOURCE 0 宋体,9,N
DESTINATION 0 宋体,9,N</a:FontList>
<a:FontList> 0 Arial,8,N</a:FontList>
<c:SourceSymbol>
<o:TableSymbol Ref="o466"/>
</c:SourceSymbol>
@ -17011,15 +16946,13 @@ DESTINATION 0 宋体,9,N</a:FontList>
<o:ReferenceSymbol Id="o469">
<a:CreationDate>1656491854</a:CreationDate>
<a:ModificationDate>1656491854</a:ModificationDate>
<a:Rect>((-21524,-5550), (-16124,2175))</a:Rect>
<a:Rect>((-19049,-5550), (-18599,2175))</a:Rect>
<a:ListOfPoints>((-18824,-5550),(-18824,2175))</a:ListOfPoints>
<a:CornerStyle>2</a:CornerStyle>
<a:ArrowStyle>1</a:ArrowStyle>
<a:LineColor>16711680</a:LineColor>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>CENTER 0 宋体,9,N
SOURCE 0 宋体,9,N
DESTINATION 0 宋体,9,N</a:FontList>
<a:FontList> 0 Arial,8,N</a:FontList>
<c:SourceSymbol>
<o:TableSymbol Ref="o470"/>
</c:SourceSymbol>
@ -17040,7 +16973,6 @@ DESTINATION 0 宋体,9,N</a:FontList>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>STRN 0 Arial Unicode MS,8,N
DISPNAME 0 宋体,9,N
OWNRDISPNAME 0 宋体,9,N
Columns 0 宋体,9,N
TablePkColumns 0 宋体,9,N
TableFkColumns 0 宋体,9,N
@ -17063,7 +16995,6 @@ LABL 0 Arial Unicode MS,8,N</a:FontList>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>STRN 0 Arial Unicode MS,8,N
DISPNAME 0 宋体,9,N
OWNRDISPNAME 0 宋体,9,N
Columns 0 宋体,9,N
TablePkColumns 0 宋体,9,N
TableFkColumns 0 宋体,9,N
@ -17086,7 +17017,6 @@ LABL 0 Arial Unicode MS,8,N</a:FontList>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>STRN 0 Arial Unicode MS,8,N
DISPNAME 0 宋体,9,N
OWNRDISPNAME 0 宋体,9,N
Columns 0 宋体,9,N
TablePkColumns 0 宋体,9,N
TableFkColumns 0 宋体,9,N
@ -17109,7 +17039,6 @@ LABL 0 Arial Unicode MS,8,N</a:FontList>
<a:ShadowColor>12632256</a:ShadowColor>
<a:FontList>STRN 0 Arial Unicode MS,8,N
DISPNAME 0 宋体,9,N
OWNRDISPNAME 0 宋体,9,N
Columns 0 宋体,9,N
TablePkColumns 0 宋体,9,N
TableFkColumns 0 宋体,9,N
@ -102682,7 +102611,7 @@ Shadow=0</a:DisplayPreferences>
<a:Code>SystemManager7</a:Code>
<a:CreationDate>1248331945</a:CreationDate>
<a:Creator>Administrator</a:Creator>
<a:ModificationDate>1714120566</a:ModificationDate>
<a:ModificationDate>1715421020</a:ModificationDate>
<a:Modifier>Administrator</a:Modifier>
<a:Comment>系统管理</a:Comment>
<a:PackageOptionsText>[FolderOptions]
@ -104662,7 +104591,7 @@ CheckRequested=Yes</a:PackageOptionsText>
<a:Code>SystemManager11</a:Code>
<a:CreationDate>1713342619</a:CreationDate>
<a:Creator>Administrator</a:Creator>
<a:ModificationDate>1714120566</a:ModificationDate>
<a:ModificationDate>1715421020</a:ModificationDate>
<a:Modifier>Administrator</a:Modifier>
<a:DisplayPreferences>[DisplayPreferences]

@ -5,7 +5,7 @@
/// </summary>
[Produces("application/json")]
[Route("api/Common")]
[ApiExplorerSettings(GroupName = Grouping.GroupName_System)]
[Authorize(Permissions.Name), ApiExplorerSettings(GroupName = Grouping.GroupName_System)]
public class CommonController : BaseApiController
{
private readonly ILogger<TiobonController> _logger;

@ -10,7 +10,6 @@ namespace Tiobon.Core.Api.Controllers;
[ApiController, GlobalActionFilter]
[Authorize(Permissions.Name), ApiExplorerSettings(GroupName = Grouping.GroupName_Ghre)]
public class Ghre_CourseClassController : BaseApiController
//public class Ghre_CourseClassController : BaseController<IGhre_CourseClassServices, Ghre_CourseClass, Ghre_CourseClassDto, InsertGhre_CourseClassInput, EditGhre_CourseClassInput>
{
protected IGhre_CourseClassServices _service;
@ -19,8 +18,6 @@ public class Ghre_CourseClassController : BaseApiController
_service = service;
}
//public Ghre_CourseClassController(IGhre_CourseClassServices service) : base(service) { }
#region 基础接口
#region 查询

@ -1,6 +1,4 @@
using Microsoft.AspNetCore.Mvc.Filters;
using System.Security.Claims;
using Tiobon.Core.Model;
namespace Tiobon.Core.Api.Filter
{

@ -119,5 +119,6 @@ public class JsonParam
{
public string columnValue { get; set; }
public string operationKey { get; set; }
public string token { get; set; }
}

@ -1,17 +1,15 @@
using Tiobon.Core.Common.Swagger;
using Tiobon.Core.Model;
using System.IdentityModel.Tokens.Jwt;
using System.Security.Claims;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.IdentityModel.Tokens.Jwt;
using System.Linq;
using System.Security.Claims;
using Newtonsoft.Json;
using Tiobon.Core.Common.Swagger;
using Tiobon.Core.Model;
namespace Tiobon.Core.Common.HttpContextUser;
namespace Tiobon.Core.Common.HttpContextUser
public class AspNetUser : IUser
{
public class AspNetUser : IUser
{
private readonly IHttpContextAccessor _accessor;
private readonly ILogger<AspNetUser> _logger;
@ -31,12 +29,13 @@ namespace Tiobon.Core.Common.HttpContextUser
}
else
{
if (!string.IsNullOrEmpty(GetToken()))
var token = GetToken();
if (!string.IsNullOrEmpty(token))
{
var getNameType = Permissions.IsUseIds4
? "name"
: "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name";
return GetUserInfoFromToken(getNameType).FirstOrDefault().ObjToString();
return GetUserInfoFromToken(getNameType, token).FirstOrDefault().ObjToString();
}
}
@ -56,9 +55,24 @@ namespace Tiobon.Core.Common.HttpContextUser
{
var token = _accessor.HttpContext?.Request?.Headers["Authorization"].ObjToString().Replace("Bearer ", "");
if (!token.IsNullOrEmpty())
{
return token;
}
//var request = _accessor.HttpContext?.Request;
//if (request != null && request?.Body != null)
//{
// var sr = new StreamReader(request?.Body);
// var BodyData = sr.ReadToEnd();
// var jsonParam = JsonConvert.DeserializeObject<JsonParam>(BodyData);
// if (jsonParam != null && !jsonParam.token.IsNullOrEmpty())
// {
// if (_accessor.HttpContext?.Request?.Headers.Any(x => x.Key == "Authorization") == true)
// _accessor.HttpContext.Request.Headers["Authorization"] = jsonParam.token;
// else
// _accessor.HttpContext.Request.Headers.Add("Authorization", "Bearer " + jsonParam.token);
// return jsonParam.token;
// }
//}
if (_accessor.HttpContext?.IsSuccessSwagger() == true)
{
@ -66,9 +80,7 @@ namespace Tiobon.Core.Common.HttpContextUser
if (token.IsNotEmptyOrNull())
{
if (_accessor.HttpContext.User.Claims.Any(s => s.Type == JwtRegisteredClaimNames.Jti))
{
return token;
}
var claims = new ClaimsIdentity(GetClaimsIdentity(token));
_accessor.HttpContext.User.AddIdentity(claims);
@ -79,12 +91,10 @@ namespace Tiobon.Core.Common.HttpContextUser
return token;
}
public List<string> GetUserInfoFromToken(string ClaimType)
public List<string> GetUserInfoFromToken(string ClaimType, string token)
{
var jwtHandler = new JwtSecurityTokenHandler();
var token = "";
token = GetToken();
// token校验
if (token.IsNotEmptyOrNull() && jwtHandler.CanReadToken(token))
{
@ -136,5 +146,4 @@ namespace Tiobon.Core.Common.HttpContextUser
where item.Type == ClaimType
select item.Value).ToList();
}
}
}

@ -1,11 +1,10 @@
using System.Collections.Generic;
using System.Security.Claims;
using System.Security.Claims;
using Tiobon.Core.Model;
namespace Tiobon.Core.Common.HttpContextUser
namespace Tiobon.Core.Common.HttpContextUser;
public interface IUser
{
public interface IUser
{
string Name { get; }
long ID { get; }
long TenantId { get; }
@ -14,8 +13,7 @@ namespace Tiobon.Core.Common.HttpContextUser
List<string> GetClaimValueByType(string ClaimType);
string GetToken();
List<string> GetUserInfoFromToken(string ClaimType);
List<string> GetUserInfoFromToken(string ClaimType, string token);
ServiceResult<string> MessageModel { get; set; }
}
}

@ -1,18 +1,16 @@
using Tiobon.Core.Model;
using System.Text.Encodings.Web;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Newtonsoft.Json;
using System;
using System.Text.Encodings.Web;
using System.Threading.Tasks;
using Tiobon.Core.Common.HttpContextUser;
using Tiobon.Core.Model;
namespace Tiobon.Core.AuthHelper
namespace Tiobon.Core.AuthHelper;
public class ApiResponseHandler : AuthenticationHandler<AuthenticationSchemeOptions>
{
public class ApiResponseHandler : AuthenticationHandler<AuthenticationSchemeOptions>
{
private readonly IUser _user;
public ApiResponseHandler(IOptionsMonitor<AuthenticationSchemeOptions> options, ILoggerFactory logger, UrlEncoder encoder, ISystemClock clock, IUser user) : base(options, logger, encoder, clock)
@ -46,5 +44,4 @@ namespace Tiobon.Core.AuthHelper
await Response.WriteAsync(JsonConvert.SerializeObject((new ApiResponse(StatusCode.CODE403)).MessageModel));
}
}
}
}

@ -1,17 +1,15 @@
using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Tiobon.Core.AuthHelper.OverWrite;
using Microsoft.AspNetCore.Http;
namespace Tiobon.Core.Extensions.Middlewares
namespace Tiobon.Core.Extensions.Middlewares;
/// <summary>
/// 中间件
/// 原做为自定义授权中间件
/// 先做检查 header token的使用
/// </summary>
public class JwtTokenAuthMiddleware
{
/// <summary>
/// 中间件
/// 原做为自定义授权中间件
/// 先做检查 header token的使用
/// </summary>
public class JwtTokenAuthMiddleware
{
/// <summary>
///
/// </summary>
@ -86,7 +84,5 @@ namespace Tiobon.Core.Extensions.Middlewares
return _next(httpContext);
}
}
}

@ -8,13 +8,13 @@ using Microsoft.IdentityModel.Tokens;
using System.IdentityModel.Tokens.Jwt;
using System.Text;
namespace Tiobon.Core.Extensions
namespace Tiobon.Core.Extensions;
/// <summary>
/// JWT权限 认证服务
/// </summary>
public static class Authentication_JWTSetup
{
/// <summary>
/// JWT权限 认证服务
/// </summary>
public static class Authentication_JWTSetup
{
public static void AddAuthentication_JWTSetup(this IServiceCollection services)
{
if (services == null) throw new ArgumentNullException(nameof(services));
@ -107,5 +107,4 @@ namespace Tiobon.Core.Extensions
.AddScheme<AuthenticationSchemeOptions, ApiResponseHandler>(nameof(ApiResponseHandler), o => { });
}
}
}

@ -282,6 +282,14 @@ public partial class CommonServices : BaseServices<RootEntityTkey<int>>, ICommon
if (toolbar != null) { toolbar.fnKey = "TBD1YN"; }
toolbar = result.JM_PageControlT1.Toolbar.Where(x => x.fnKey == "UpdateYN").FirstOrDefault();
if (toolbar != null) { toolbar.fnKey = "TBD2YN"; }
}else if (param.menuName == "F_ExamPaperDraft")
{
var toolbar = result.JM_PageControlT1.Toolbar.Where(x => x.fnKey == "NewYN").FirstOrDefault();
if (toolbar != null) { toolbar.fnKey = "TBD1YN"; }
toolbar = result.JM_PageControlT1.Toolbar.Where(x => x.fnKey == "UpdateYN").FirstOrDefault();
if (toolbar != null) { toolbar.fnKey = "TBD2YN"; }
toolbar = result.JM_PageControlT1.Toolbar.Where(x => x.fnKey == "DetailYN").FirstOrDefault();
if (toolbar != null) { toolbar.fnKey = "TBD3YN"; }
}
#endregion

Loading…
Cancel
Save