懒得勤快 4 年之前
父节点
当前提交
0eee5b2dae

+ 2 - 2
src/Masuit.MyBlogs.Core/Controllers/ShortController.cs

@@ -7,9 +7,9 @@ namespace Masuit.MyBlogs.Core.Controllers
     public class ShortController : Controller
     {
         [HttpGet("short"), MyAuthorize]
-        public IActionResult Short(string url)
+        public IActionResult Short(string key, string url)
         {
-            var id = url.Crc32().FromBinary(16).ToBinary(62);
+            var id = string.IsNullOrEmpty(key) ? url.Crc32().FromBinary(16).ToBinary(62) : key;
             RedisHelper.Set("shorturl:" + id, url);
             return Ok(id);
         }

+ 2 - 2
src/Masuit.MyBlogs.Core/Masuit.MyBlogs.Core.csproj

@@ -58,7 +58,7 @@
         <PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson" Version="5.0.2" />
         <PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="5.0.2" />
         <PackageReference Include="Microsoft.Extensions.Http.Polly" Version="5.0.1" />
-        <PackageReference Include="Microsoft.Graph" Version="3.22.0" />
+        <PackageReference Include="Microsoft.Graph" Version="3.23.0" />
         <PackageReference Include="Microsoft.Graph.Auth" Version="1.0.0-preview.6" />
         <PackageReference Include="MiniProfiler.AspNetCore.Mvc" Version="4.2.22" />
         <PackageReference Include="OpenXmlPowerTools-NetStandard" Version="4.4.21" />
@@ -72,7 +72,7 @@
         <PackageReference Include="TimeZoneConverter" Version="3.3.0" />
         <PackageReference Include="WilderMinds.RssSyndication" Version="1.7.0" />
         <PackageReference Include="WinInsider.System.Net.Http.Formatting" Version="1.0.14" />
-        <PackageReference Include="Z.EntityFramework.Plus.EFCore" Version="5.1.15" />
+        <PackageReference Include="Z.EntityFramework.Plus.EFCore" Version="5.1.16" />
     </ItemGroup>
     <ItemGroup>
         <Content Update="appsettings.json">