Skip to content

Commit d145542

Browse files
committed
删除NoASP
1 parent 112d49a commit d145542

20 files changed

+60
-108
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"version": 1,
3+
"isRoot": true,
4+
"tools": {
5+
"dotnet-ef": {
6+
"version": "5.0.10",
7+
"commands": [
8+
"dotnet-ef"
9+
]
10+
}
11+
}
12+
}

ColoryrServer/ASP/ASPConfig.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
namespace ColoryrServer.ASP
55
{
66
internal record Rote
7-
{
7+
{
88
public string Url { get; set; }
99
}
1010
internal record ASPConfig : MainConfig

ColoryrServer/ASP/Http/ASPHttpUtils.cs ColoryrServer/ASP/ASPHttpUtils.cs

+2-5
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,9 @@
22
{
33
public class ASPHttpUtils
44
{
5-
public static string HaveCookie(IHeaderDictionary hashtable)
5+
public static string HaveCookie(string hashtable)
66
{
7-
string Temp = hashtable.Cookie;
8-
if (Temp == null)
9-
return null;
10-
string[] Cookies = Temp.Split(';');
7+
string[] Cookies = hashtable.Split(';');
118
foreach (var Item in Cookies)
129
{
1310
var temp = Item.Replace(" ", "");

ColoryrServer/ASP/Http/ASPHttpGet.cs

-54
This file was deleted.

ColoryrServer/ASP/Program.cs

+43-6
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public bool IsEnabled(LogLevel logLevel)
3232
}
3333

3434
public void Log<TState>(LogLevel logLevel, EventId eventId, TState state,
35-
Exception exception, Func<TState, Exception, string> formatter)
35+
Exception? exception, Func<TState, Exception, string> formatter)
3636
{
3737
if (eventId.Id == 100 || eventId.Id == 101)
3838
return;
@@ -153,7 +153,7 @@ public static void Main()
153153

154154
Web.MapPost("/", PostBuild);
155155
Web.MapPost("/{**name}", GetWeb);
156-
// Web.MapPost("/{uuid}/{name}", GetGetWeb1);
156+
// Web.MapPost("/{uuid}/{name}", GetGetWeb1);
157157
Web.MapPost(ServerMain.Config.Requset.WebAPI + "/{uuid}", POSTBack);
158158
Web.MapPost(ServerMain.Config.Requset.WebAPI + "/{uuid}/{name}", POSTBack);
159159

@@ -168,7 +168,6 @@ private static async Task PostBuild(HttpContext context)
168168
{
169169
HttpRequest Request = context.Request;
170170
HttpResponse Response = context.Response;
171-
HttpReturn httpReturn;
172171
if (Request.Headers[BuildKV.BuildK] == BuildKV.BuildV)
173172
{
174173
string Str;
@@ -238,7 +237,45 @@ private static async Task GetBack(HttpContext context)
238237
HttpReturn httpReturn;
239238
var uuid = context.GetRouteValue("uuid") as string;
240239
var name = context.GetRouteValue("name") as string;
241-
httpReturn = ASPHttpGet.HttpGET(Request.Path, Request.Headers, Request.QueryString, uuid, name);
240+
string Url = Request.Path;
241+
if (Url.StartsWith("//"))
242+
{
243+
Url = Url[1..];
244+
}
245+
var Dll = DllStonge.GetDll(uuid);
246+
if (Dll != null)
247+
{
248+
var Temp = new Dictionary<string, dynamic>();
249+
if (Request.QueryString.HasValue)
250+
{
251+
foreach (string a in Request.QueryString.Value.Split('&'))
252+
{
253+
var item = a.Split("=");
254+
Temp.Add(item[0], item[1]);
255+
}
256+
}
257+
NameValueCollection collection = new();
258+
foreach (var item in Request.Headers)
259+
{
260+
collection.Add(item.Key, item.Value);
261+
}
262+
httpReturn = DllRun.DllGo(Dll, new()
263+
{
264+
Cookie = ASPHttpUtils.HaveCookie(Request.Headers.Cookie),
265+
RowRequest = collection,
266+
Parameter = Temp,
267+
ContentType = MyContentType.XFormData
268+
}, name);
269+
}
270+
else
271+
{
272+
httpReturn = new()
273+
{
274+
Data = HtmlUtils.Html404,
275+
ContentType = ServerContentType.HTML,
276+
ReCode = 200
277+
};
278+
}
242279
Response.ContentType = httpReturn.ContentType;
243280
Response.StatusCode = httpReturn.ReCode;
244281
if (httpReturn.Head != null)
@@ -343,7 +380,7 @@ private static async Task GetWeb(HttpContext context)
343380
Response.ContentType = httpReturn.ContentType;
344381
Response.StatusCode = httpReturn.ReCode;
345382
await Response.BodyWriter.WriteAsync(httpReturn.Data);
346-
}
383+
}
347384
}
348385

349386
private static async Task POSTBack(HttpContext context)
@@ -453,7 +490,7 @@ private static async Task POSTBack(HttpContext context)
453490

454491
httpReturn = DllRun.DllGo(Dll, new()
455492
{
456-
Cookie = ASPHttpUtils.HaveCookie(Request.Headers),
493+
Cookie = ASPHttpUtils.HaveCookie(Request.Headers.Cookie),
457494
Parameter = temp,
458495
RowRequest = collection,
459496
ContentType = type,

ColoryrServer/ASP/Properties/PublishProfiles/FolderProfile.pubxml

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,12 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
88
<ExcludeApp_Data>False</ExcludeApp_Data>
99
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
1010
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
11-
<LastUsedPlatform>Any CPU</LastUsedPlatform>
11+
<LastUsedPlatform>x64</LastUsedPlatform>
1212
<PublishProvider>FileSystem</PublishProvider>
1313
<PublishUrl>..\..\build_out\Publish\ASP\</PublishUrl>
1414
<WebPublishMethod>FileSystem</WebPublishMethod>
1515
<SiteUrlToLaunchAfterPublish />
1616
<TargetFramework>net6.0</TargetFramework>
17-
<RuntimeIdentifier>linux-x64</RuntimeIdentifier>
1817
<ProjectGuid>ce8e78c5-911d-4423-8dee-51aa8afb3f74</ProjectGuid>
1918
<SelfContained>false</SelfContained>
2019
</PropertyGroup>

ColoryrServer/ASP/Properties/launchSettings.json

-28
This file was deleted.

ColoryrServer/Core/ColoryrServer.Core.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</PropertyGroup>
1111

1212
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
13-
<OutputPath>..\..\build_out\ServerCore</OutputPath>
13+
<OutputPath>..\..\build_out\Core</OutputPath>
1414
<PlatformTarget>x64</PlatformTarget>
1515
</PropertyGroup>
1616

ColoryrServer/Core/FileSystem/HtmlUtils.cs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using ColoryrServer.Core;
22
using ColoryrServer.SDK;
33
using Lib.Build.Object;
4-
using Lib.Server;
54
using Newtonsoft.Json;
65
using System;
76
using System.Collections.Concurrent;

ColoryrWork.sln

-10
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Lib.App", "Lib.App\Lib.App.
1919
EndProject
2020
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ColoryrServer.ASP", "ColoryrServer\ASP\ColoryrServer.ASP.csproj", "{CE8E78C5-911D-4423-8DEE-51AA8AFB3F74}"
2121
EndProject
22-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ColoryrServer.NoASP", "ColoryrServer\NoASP\ColoryrServer.NoASP.csproj", "{BD201938-3655-45CB-8427-AE4D04B756F7}"
23-
EndProject
2422
Global
2523
GlobalSection(SharedMSBuildProjectFiles) = preSolution
2624
Lib\Lib.Server\Lib.Server.projitems*{013195f8-cd93-4c2e-b3f8-d1706c16eebb}*SharedItemsImports = 13
@@ -71,14 +69,6 @@ Global
7169
{CE8E78C5-911D-4423-8DEE-51AA8AFB3F74}.Release|Any CPU.Build.0 = Release|Any CPU
7270
{CE8E78C5-911D-4423-8DEE-51AA8AFB3F74}.Release|x64.ActiveCfg = Release|Any CPU
7371
{CE8E78C5-911D-4423-8DEE-51AA8AFB3F74}.Release|x64.Build.0 = Release|Any CPU
74-
{BD201938-3655-45CB-8427-AE4D04B756F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
75-
{BD201938-3655-45CB-8427-AE4D04B756F7}.Debug|Any CPU.Build.0 = Debug|Any CPU
76-
{BD201938-3655-45CB-8427-AE4D04B756F7}.Debug|x64.ActiveCfg = Debug|Any CPU
77-
{BD201938-3655-45CB-8427-AE4D04B756F7}.Debug|x64.Build.0 = Debug|Any CPU
78-
{BD201938-3655-45CB-8427-AE4D04B756F7}.Release|Any CPU.ActiveCfg = Release|Any CPU
79-
{BD201938-3655-45CB-8427-AE4D04B756F7}.Release|Any CPU.Build.0 = Release|Any CPU
80-
{BD201938-3655-45CB-8427-AE4D04B756F7}.Release|x64.ActiveCfg = Release|Any CPU
81-
{BD201938-3655-45CB-8427-AE4D04B756F7}.Release|x64.Build.0 = Release|Any CPU
8272
EndGlobalSection
8373
GlobalSection(SolutionProperties) = preSolution
8474
HideSolutionNode = FALSE
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)