Skip to content

Commit

Permalink
删除NoASP
Browse files Browse the repository at this point in the history
  • Loading branch information
Coloryr committed Oct 12, 2021
1 parent 112d49a commit d145542
Show file tree
Hide file tree
Showing 20 changed files with 60 additions and 108 deletions.
12 changes: 12 additions & 0 deletions ColoryrServer/ASP/.config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": 1,
"isRoot": true,
"tools": {
"dotnet-ef": {
"version": "5.0.10",
"commands": [
"dotnet-ef"
]
}
}
}
2 changes: 1 addition & 1 deletion ColoryrServer/ASP/ASPConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace ColoryrServer.ASP
{
internal record Rote
{
{
public string Url { get; set; }
}
internal record ASPConfig : MainConfig
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@
{
public class ASPHttpUtils
{
public static string HaveCookie(IHeaderDictionary hashtable)
public static string HaveCookie(string hashtable)
{
string Temp = hashtable.Cookie;
if (Temp == null)
return null;
string[] Cookies = Temp.Split(';');
string[] Cookies = hashtable.Split(';');
foreach (var Item in Cookies)
{
var temp = Item.Replace(" ", "");
Expand Down
54 changes: 0 additions & 54 deletions ColoryrServer/ASP/Http/ASPHttpGet.cs

This file was deleted.

49 changes: 43 additions & 6 deletions ColoryrServer/ASP/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public bool IsEnabled(LogLevel logLevel)
}

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

Web.MapPost("/", PostBuild);
Web.MapPost("/{**name}", GetWeb);
// Web.MapPost("/{uuid}/{name}", GetGetWeb1);
// Web.MapPost("/{uuid}/{name}", GetGetWeb1);
Web.MapPost(ServerMain.Config.Requset.WebAPI + "/{uuid}", POSTBack);
Web.MapPost(ServerMain.Config.Requset.WebAPI + "/{uuid}/{name}", POSTBack);

Expand All @@ -168,7 +168,6 @@ private static async Task PostBuild(HttpContext context)
{
HttpRequest Request = context.Request;
HttpResponse Response = context.Response;
HttpReturn httpReturn;
if (Request.Headers[BuildKV.BuildK] == BuildKV.BuildV)
{
string Str;
Expand Down Expand Up @@ -238,7 +237,45 @@ private static async Task GetBack(HttpContext context)
HttpReturn httpReturn;
var uuid = context.GetRouteValue("uuid") as string;
var name = context.GetRouteValue("name") as string;
httpReturn = ASPHttpGet.HttpGET(Request.Path, Request.Headers, Request.QueryString, uuid, name);
string Url = Request.Path;
if (Url.StartsWith("//"))
{
Url = Url[1..];
}
var Dll = DllStonge.GetDll(uuid);
if (Dll != null)
{
var Temp = new Dictionary<string, dynamic>();
if (Request.QueryString.HasValue)
{
foreach (string a in Request.QueryString.Value.Split('&'))
{
var item = a.Split("=");
Temp.Add(item[0], item[1]);
}
}
NameValueCollection collection = new();
foreach (var item in Request.Headers)
{
collection.Add(item.Key, item.Value);
}
httpReturn = DllRun.DllGo(Dll, new()
{
Cookie = ASPHttpUtils.HaveCookie(Request.Headers.Cookie),
RowRequest = collection,
Parameter = Temp,
ContentType = MyContentType.XFormData
}, name);
}
else
{
httpReturn = new()
{
Data = HtmlUtils.Html404,
ContentType = ServerContentType.HTML,
ReCode = 200
};
}
Response.ContentType = httpReturn.ContentType;
Response.StatusCode = httpReturn.ReCode;
if (httpReturn.Head != null)
Expand Down Expand Up @@ -343,7 +380,7 @@ private static async Task GetWeb(HttpContext context)
Response.ContentType = httpReturn.ContentType;
Response.StatusCode = httpReturn.ReCode;
await Response.BodyWriter.WriteAsync(httpReturn.Data);
}
}
}

private static async Task POSTBack(HttpContext context)
Expand Down Expand Up @@ -453,7 +490,7 @@ private static async Task POSTBack(HttpContext context)

httpReturn = DllRun.DllGo(Dll, new()
{
Cookie = ASPHttpUtils.HaveCookie(Request.Headers),
Cookie = ASPHttpUtils.HaveCookie(Request.Headers.Cookie),
Parameter = temp,
RowRequest = collection,
ContentType = type,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<ExcludeApp_Data>False</ExcludeApp_Data>
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<LastUsedPlatform>x64</LastUsedPlatform>
<PublishProvider>FileSystem</PublishProvider>
<PublishUrl>..\..\build_out\Publish\ASP\</PublishUrl>
<WebPublishMethod>FileSystem</WebPublishMethod>
<SiteUrlToLaunchAfterPublish />
<TargetFramework>net6.0</TargetFramework>
<RuntimeIdentifier>linux-x64</RuntimeIdentifier>
<ProjectGuid>ce8e78c5-911d-4423-8dee-51aa8afb3f74</ProjectGuid>
<SelfContained>false</SelfContained>
</PropertyGroup>
Expand Down
28 changes: 0 additions & 28 deletions ColoryrServer/ASP/Properties/launchSettings.json

This file was deleted.

2 changes: 1 addition & 1 deletion ColoryrServer/Core/ColoryrServer.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutputPath>..\..\build_out\ServerCore</OutputPath>
<OutputPath>..\..\build_out\Core</OutputPath>
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>

Expand Down
1 change: 0 additions & 1 deletion ColoryrServer/Core/FileSystem/HtmlUtils.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using ColoryrServer.Core;
using ColoryrServer.SDK;
using Lib.Build.Object;
using Lib.Server;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
Expand Down
10 changes: 0 additions & 10 deletions ColoryrWork.sln
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Lib.App", "Lib.App\Lib.App.
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ColoryrServer.ASP", "ColoryrServer\ASP\ColoryrServer.ASP.csproj", "{CE8E78C5-911D-4423-8DEE-51AA8AFB3F74}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ColoryrServer.NoASP", "ColoryrServer\NoASP\ColoryrServer.NoASP.csproj", "{BD201938-3655-45CB-8427-AE4D04B756F7}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
Lib\Lib.Server\Lib.Server.projitems*{013195f8-cd93-4c2e-b3f8-d1706c16eebb}*SharedItemsImports = 13
Expand Down Expand Up @@ -71,14 +69,6 @@ Global
{CE8E78C5-911D-4423-8DEE-51AA8AFB3F74}.Release|Any CPU.Build.0 = Release|Any CPU
{CE8E78C5-911D-4423-8DEE-51AA8AFB3F74}.Release|x64.ActiveCfg = Release|Any CPU
{CE8E78C5-911D-4423-8DEE-51AA8AFB3F74}.Release|x64.Build.0 = Release|Any CPU
{BD201938-3655-45CB-8427-AE4D04B756F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BD201938-3655-45CB-8427-AE4D04B756F7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BD201938-3655-45CB-8427-AE4D04B756F7}.Debug|x64.ActiveCfg = Debug|Any CPU
{BD201938-3655-45CB-8427-AE4D04B756F7}.Debug|x64.Build.0 = Debug|Any CPU
{BD201938-3655-45CB-8427-AE4D04B756F7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BD201938-3655-45CB-8427-AE4D04B756F7}.Release|Any CPU.Build.0 = Release|Any CPU
{BD201938-3655-45CB-8427-AE4D04B756F7}.Release|x64.ActiveCfg = Release|Any CPU
{BD201938-3655-45CB-8427-AE4D04B756F7}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
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.
File renamed without changes.
File renamed without changes.

0 comments on commit d145542

Please sign in to comment.