瀏覽代碼

修复无法打开图像

loki.wu 2 年之前
父節點
當前提交
ff551c7537
共有 2 個文件被更改,包括 8 次插入4 次删除
  1. 1 1
      fis/App.axaml.cs
  2. 7 3
      fis/SlaveWindow.axaml.cs

+ 1 - 1
fis/App.axaml.cs

@@ -36,7 +36,7 @@ namespace fis
             try
             {
                 var manager = AppManager.Get<ISecondaryScreenManager>();
-                await manager.ShowWindowByTypeAsync(WindowType.Measure, "http://" + ShellConfig.Instance.AppHost, new System.Collections.Generic.Dictionary<string, string>(),false);
+                await manager.ShowWindowByTypeAsync(WindowType.Measure, "http://" + ShellConfig.Instance.AppHost+ "/index.html", new System.Collections.Generic.Dictionary<string, string>(),false);
             }
             catch (Exception ex) {
                 

+ 7 - 3
fis/SlaveWindow.axaml.cs

@@ -132,8 +132,10 @@ namespace fis
             if (_host.Contains(ShellConfig.Instance.DistHost))
             {
                 var appHandler = new FileSystemHostHandler(ShellConfig.Instance.DistHost , ShellConfig.Instance.DistResourcePath);
+             
                 var handler = new HostRequestHandler();
                 handler.RegisterHostHandler(appHandler);
+            
                 _browser = new AvaloniaCefBrowser
                 {
                     RequestHandler = handler
@@ -142,8 +144,10 @@ namespace fis
             else 
             {
                 var appHandler = new FileSystemHostHandler(ShellConfig.Instance.AppHost, ShellConfig.Instance.AppResourcePath);
+                var resourceHandler = new FileSystemHostHandler(ShellConfig.Instance.LocalResourceHost, ShellConfig.Instance.LocalResourcePath);
                 var handler = new HostRequestHandler();
-           
+              //  handler.RegisterHostHandler(resourceHandler);
+                handler.RegisterHostHandler(appHandler);
                 _browser = new AvaloniaCefBrowser
                 {
                     RequestHandler = handler
@@ -194,8 +198,8 @@ namespace fis
                 _browser.RegisterJavascriptObject(scriptObj, "FisShellApi");
             }
             else {
-                var scriptObj = new FisBrowserScriptObject(_title, platformService);
-                _browser.RegisterJavascriptObject(scriptObj, "FisShellNotify");
+              //  var scriptObj = new FisBrowserScriptObject(_title, platformService);
+               // _browser.RegisterJavascriptObject(scriptObj, "FisShellNotify");
             }
             browserContainer.Child = _browser;
             WindowStartupLocation = WindowStartupLocation.Manual;