From b3ece1ad61ee44d4d16a66741507e468d57a255b Mon Sep 17 00:00:00 2001 From: Cheney Date: Thu, 17 Oct 2024 15:37:21 +0800 Subject: [PATCH] =?UTF-8?q?url=20=E9=85=8D=E7=BD=AE=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aardiowin/default.aproj | 2 +- aardiowin/lib/init.aardio | 8 ++++++++ aardiowin/main.aardio | 9 ++++++--- portable-template/config.json | 10 +++++----- 4 files changed, 20 insertions(+), 9 deletions(-) diff --git a/aardiowin/default.aproj b/aardiowin/default.aproj index 162eca4..562047b 100644 --- a/aardiowin/default.aproj +++ b/aardiowin/default.aproj @@ -1,5 +1,5 @@  - + diff --git a/aardiowin/lib/init.aardio b/aardiowin/lib/init.aardio index 73615f2..9820f62 100644 --- a/aardiowin/lib/init.aardio +++ b/aardiowin/lib/init.aardio @@ -64,11 +64,16 @@ namespace init{ object.merge(configs, appDataConfig, true); } + checkConfig(configs); gLog.print("configs", util.table.stringify(configs, true)); return configs; }; + /* + * 默认配置 + */ checkConfig = function (config){ + gLog.print("checkConfig"); if( ! config.window ){ config.window = {} } @@ -78,6 +83,9 @@ namespace init{ if( ! config.window.height ) { config.window.height = 500 } + if( (! config.frontend) or config.frontend == "" ){ + config.frontend = "web/index.html" + } return config; } diff --git a/aardiowin/main.aardio b/aardiowin/main.aardio index 5c98316..501b3eb 100644 --- a/aardiowin/main.aardio +++ b/aardiowin/main.aardio @@ -110,13 +110,16 @@ import wsock.tcp.simpleHttpServer; 去掉下面的前端项目调试端口号 37151 或发布 EXE 后运行才会打开 "\web\index.html"。 否则打开 http://localhost:37151 */ + +var url = gConfig.frontend +gLog.print("url=" , url) if( gDebug ){ - theView.go("\web\index.html",37151); + theView.go(url,37151); } else { - theView.go("\web\index.html"); + theView.go(url); } mainForm.show(); win.loopMessage(); -// tray.delete(); +// tray.delete(); \ No newline at end of file diff --git a/portable-template/config.json b/portable-template/config.json index 3bee312..f5a6323 100644 --- a/portable-template/config.json +++ b/portable-template/config.json @@ -1,11 +1,11 @@ { - "app" : "", - "title" : "", + "app" : "awin-portable-template", + "title" : "awin portable template", "icon" : "", "backend" : "", - "frontend" : "", + "frontend" : "dist/index.html", "window" : { - "width" : "", - "height" : "" + "width" : 1024, + "height" : 768 } } \ No newline at end of file