3 Commits 001b2283cb ... 4494d57fbf

Author SHA1 Message Date
  dukuisong 4494d57fbf kelin update 1 month ago
  dukuisong a9d5f0d735 Merge remote-tracking branch 'origin/kylin' into kylin 1 month ago
  dukuisong 41a2dac52d kelin update 1 month ago
5 changed files with 14 additions and 7 deletions
  1. 11 3
      api/api_app.py
  2. 0 1
      office_helper.py
  3. 1 1
      office_helper.spec
  4. 1 1
      readme.md
  5. 1 1
      script/install_autostart.sh

+ 11 - 3
api/api_app.py

@@ -385,9 +385,17 @@ def yozo_plugin_monitor():
     option = request.get_json()['option']
     yozo_path = os.path.dirname(os.path.dirname(config.yozoc))
     plugin_path = os.path.join(yozo_path, 'Plugins','yozooffice-jar-with-dependencies.jar')
-
-    flag = os.path.exists(plugin_path)
-    return jsonify({'code': 1000, 'msg': 'plugin_status', 'data': flag})
+    msg = '操作成功'
+    if option == 'install':
+        if os.path.exists(plugin_path):
+            os.remove(plugin_path)
+        os.system(f'cp yozooffice-jar-with-dependencies.jar {plugin_path}')
+    elif option == 'uninstall':
+        if os.path.exists(plugin_path):
+            os.remove(plugin_path)
+            msg = '插件卸载成功'
+
+    return jsonify({'code': 1000, 'msg': msg})
 
 
 @logger.catch()

+ 0 - 1
office_helper.py

@@ -1,5 +1,4 @@
 import functools
-import json
 import os.path
 import sys
 import threading

+ 1 - 1
office_helper.spec

@@ -32,7 +32,7 @@ exe = EXE(
     target_arch=None,
     codesign_identity=None,
     entitlements_file=None,
-    icon=['icon.ico'],
+    icon=['icon.png'],
 )
 coll = COLLECT(
     exe,

+ 1 - 1
readme.md

@@ -29,7 +29,7 @@ upload_file
 
 pyinstaller --onefile --noconsole --windowed --icon=../icon.ico init_wps_plug.py
 
-pyinstaller --noconsole  --windowed --add-data "static:static" --icon=icon.ico office_helper.py
+pyinstaller --noconsole  --windowed --add-data "static:static" --icon=icon.png office_helper.py
 
 
 pyinstaller --onefile --noconsole  --windowed --add-data "icon.ico;." --icon=icon.ico upload_file.py

+ 1 - 1
script/install_autostart.sh

@@ -11,7 +11,7 @@ show_help() {
 }
 
 # 检查参数是否正确
-if [ $# -lt 1 ]; then
+if [ $# -lt 1 ]; thenc
     echo "错误:请提供可执行文件的路径!"
     show_help
     exit 1