gaoshuaixing %!s(int64=4) %!d(string=hai) anos
pai
achega
cea2bf35a5
Modificáronse 6 ficheiros con 34 adicións e 14 borrados
  1. 14 6
      README.md
  2. BIN=BIN
      build/img/file.png
  3. BIN=BIN
      build/img/ipc.png
  4. 11 7
      electron/config.js
  5. 8 0
      main.js
  6. 1 1
      package.json

+ 14 - 6
README.md

@@ -20,12 +20,22 @@
 7. 自动更新
 7. 自动更新
 8. 更多功能请看文档
 8. 更多功能请看文档
 
 
-## 默认UI
+## 使用场景
+
+1. 常规桌面软件
+![](https://kaka996.coding.net/p/resource/d/tx-resource/git/raw/master/img/electron-egg/file.png)
+![](https://kaka996.coding.net/p/resource/d/tx-resource/git/raw/master/img/electron-egg/xm-pic-config.png)
+
+2. 游戏(h5相关技术开发)
+
+3. 任意网站变桌面软件
+    - discuz-q论坛
+    ![](https://kaka996.coding.net/p/resource/d/tx-resource/git/raw/master/img/electron-egg/dq-feed.png)
+    ![](https://kaka996.coding.net/p/resource/d/tx-resource/git/raw/master/img/electron-egg/dq-user.png)
+
+4. web项目
 
 
-- demo使用vue编写,经典三栏样式,可自定义(使用你自己的前端页面)
 
 
-![](./build/img/file.png)
-![](./build/img/ipc.png)
 
 
 ## 开始使用
 ## 开始使用
 
 
@@ -84,8 +94,6 @@
 
 
 ![](https://cdn.jsdelivr.net/gh/wallace5303/file-resource/normal/xm-pic-config.png)
 ![](https://cdn.jsdelivr.net/gh/wallace5303/file-resource/normal/xm-pic-config.png)
 
 
-![](https://cdn.jsdelivr.net/gh/wallace5303/file-resource/normal/xm-pic-history.png)
-
 ![](https://cdn.jsdelivr.net/gh/wallace5303/file-resource/normal/xm-pic-detail.png)
 ![](https://cdn.jsdelivr.net/gh/wallace5303/file-resource/normal/xm-pic-detail.png)
 
 
 2. 可联系我(qq:530353222),展示你的项目。
 2. 可联系我(qq:530353222),展示你的项目。

BIN=BIN
build/img/file.png


BIN=BIN
build/img/ipc.png


+ 11 - 7
electron/config.js

@@ -31,21 +31,21 @@ const config = {
     }
     }
   },
   },
   windowsOption: {
   windowsOption: {
-    width: 980,
-    height: 600,
-    minWidth: 800,
-    minHeight: 600,
+    width: 500,
+    height: 900,
+    // minWidth: 500,
+    // minHeight: 600,
     webPreferences: {
     webPreferences: {
       //webSecurity: false,
       //webSecurity: false,
       contextIsolation: false, // 设置此项为false后,才可在渲染进程中使用electron api
       contextIsolation: false, // 设置此项为false后,才可在渲染进程中使用electron api
       nodeIntegration: true,
       nodeIntegration: true,
       preload: path.join(__dirname, '../preload.js')
       preload: path.join(__dirname, '../preload.js')
     },
     },
-    //frame: false,
+    frame: true,
     //titleBarStyle: 'hidden'
     //titleBarStyle: 'hidden'
   },
   },
   egg: {
   egg: {
-    title: 'electron-egg', // 进程的title属性标识,无需改动
+    title: 'electron-egg', // 进程的title属性标识(默认你的应用名称-英文)
     env: 'prod',
     env: 'prod',
     port: 7068,
     port: 7068,
     hostname: 'localhost',
     hostname: 'localhost',
@@ -71,7 +71,11 @@ const config = {
     uploadToServer: false, 
     uploadToServer: false, 
     ignoreSystemCrashHandler: true,
     ignoreSystemCrashHandler: true,
     compress: false
     compress: false
-  }
+  },
+  remoteUrl: {
+    enable: true,
+    url: 'https://discuz.chat/'
+  },
 }
 }
 
 
 exports.get = function (flag = '', env = 'prod') {
 exports.get = function (flag = '', env = 'prod') {

+ 8 - 0
main.js

@@ -80,6 +80,14 @@ async function startServer (options) {
   const protocol = 'http://'
   const protocol = 'http://'
   let startRes = null
   let startRes = null
   let url = null
   let url = null
+  const remoteConfig = electronConfig.get('remoteUrl');
+
+  if (remoteConfig.enable) {
+    url = remoteConfig.url
+    MAIN_WINDOW.loadURL(url)
+    return true
+  }
+  
   if (ENV === 'prod') {
   if (ENV === 'prod') {
     url = protocol + options.hostname + ':' + options.port
     url = protocol + options.hostname + ':' + options.port
   } else {
   } else {

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
 {
   "name": "electron-egg",
   "name": "electron-egg",
-  "version": "1.12.0",
+  "version": "1.13.0",
   "description": "A fast, desktop software development framework",
   "description": "A fast, desktop software development framework",
   "main": "main.js",
   "main": "main.js",
   "softName": "electron-egg",
   "softName": "electron-egg",