gaoshuaixing 3 年 前
コミット
d2c7544b13
5 ファイル変更36 行追加6 行削除
  1. 1 2
      .gitignore
  2. 3 0
      electron/config/config.default.js
  3. 6 0
      frontend/src/utils/request.js
  4. 4 4
      package.json
  5. 22 0
      public/dist/index.html

+ 1 - 2
.gitignore

@@ -4,5 +4,4 @@ logs/
 run/
 .idea/
 package-lock.json
-data/
-public/dist/
+data/

+ 3 - 0
electron/config/config.default.js

@@ -37,6 +37,9 @@ module.exports = (appInfo) => {
   /* 应用程序顶部菜单 */
   config.openAppMenu = false;
 
+  /* 加载loading页 */
+  config.loadingPage = true;
+
   /* 主窗口 */
   config.windowsOption = {
     width: 980,

+ 6 - 0
frontend/src/utils/request.js

@@ -14,6 +14,12 @@ const request = axios.create({
 const errorHandler = (error) => {
   if (error.response) {
     const data = error.response.data
+    if (error.response.status === 400) {
+      notification.error({
+        message: '该功能需要egg服务',
+        description: data.message
+      })
+    }
     if (error.response.status === 403) {
       notification.error({
         message: 'Forbidden',

+ 4 - 4
package.json

@@ -15,9 +15,9 @@
     "web-start": "egg-scripts start --daemon --title=ee --ignore-stderr --env=prod --workers=1",
     "web-stop": "egg-scripts stop --title=ee",
     "web-dev": "egg-bin dev",
-    "rd": "ee-cli rd --dist_dir=./frontend/dist",
-    "compress": "ee-cli compress",
-    "restore": "ee-cli restore"
+    "rd": "node ./node_modules/ee-core/bin/tools rd --dist_dir=./frontend/dist",
+    "compress": "node ./node_modules/ee-core/bin/tools compress",
+    "restore": "node ./node_modules/ee-core/bin/tools restore"
   },
   "build": {
     "productName": "ee",
@@ -105,7 +105,7 @@
     "egg-cors": "^2.2.3",
     "egg-scripts": "^2.15.2",
     "egg-view-ejs": "^2.0.1",
-    "ee-core": "^1.0.0",
+    "ee-core": "^1.1.0",
     "electron-is": "^3.0.0",
     "lodash": "^4.17.21",
     "unzip-crx-3": "^0.2.0"

+ 22 - 0
public/dist/index.html

@@ -0,0 +1,22 @@
+<html>
+ <head> 
+  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
+  <style type="text/css">
+    body{
+      margin:0px auto;
+    }
+    #cen {
+      position: absolute;
+      left: 50%;
+      top: 35%;
+      transform: translate(-50%, -50%);
+    }
+  </style> 
+  <title></title> 
+ </head> 
+ <body> 
+  <div id="cen">
+    hello ee
+  </div>  
+ </body>
+</html>