Эх сурвалжийг харах

Add ZipHandler for zip support.

Justin 2 жил өмнө
parent
commit
0748274b4f

+ 0 - 12
fis/Handlers/DynamicResourceHandler.cs

@@ -1,12 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace fis.Handlers
-{
-    class DynamicResourceHandler
-    {
-    }
-}

+ 14 - 0
fis/Managers/BrowserManager.cs

@@ -1,8 +1,10 @@
 using fis.Mac;
 using fis.Utilities;
 using fis.Win;
+using fis.Win.Handlers;
 using System;
 using System.Collections.Generic;
+using System.IO;
 using System.Runtime.InteropServices;
 using Xilium.CefGlue;
 using Xilium.CefGlue.Avalonia;
@@ -83,6 +85,18 @@ namespace fis.Managers
             }
             _requestHandler = new HostRequestHandler();
             var appHandler = new FileSystemHostHandler(ShellConfig.Instance.AppHost, ShellConfig.Instance.AppResourcePath);
+            //从Zip创建Handler
+            //Zip路径:ShellConfig.Instance.AppResourcePath + "flyinsono.zip", 即 软件目录\App\flyinsono\flyinsono.zip
+            //Zip包内容结构:
+            //flyinosno.zip
+            //  -flyinsono
+            //      -canvicekit
+            //          -canvaskit.js
+            //          -...
+            //      -index.html
+            //      -flutter.js
+            //      -.....
+            //var appHandler = new ZipHandler(ShellConfig.Instance.AppHost, Path.Combine(ShellConfig.Instance.AppResourcePath, "flyinsono.zip"));
             var resourceHandler = new FileSystemHostHandler(ShellConfig.Instance.LocalResourceHost, ShellConfig.Instance.LocalResourcePath);
             var platformHandler = new JsonRpcHandler<IPlatformService>(ShellConfig.Instance.LocalApiHost, _platformService);
             _requestHandler.RegisterHostHandler(appHandler);