pull/350/head
midoks 2 years ago
parent fbbc506de9
commit 1e97b146db
  1. 33
      class/core/plugins_api.py
  2. 2
      plugins/backup_ftp/info.json
  3. 3
      route/__init__.py

@ -265,18 +265,17 @@ class plugins_api:
valid_list_hook = ['menu']
if 'hook' in info:
hooks = info['hook']
hooks_type = type(hooks)
if hooks_type == list:
for h in hooks:
for h in hooks:
hooks_type = type(h)
if hooks_type == dict:
tag = h['tag']
if tag in valid_list_hook:
self.hookInstallFile(tag, h[tag])
elif hooks_type == str:
for x in hooks:
if x in valid_hook:
self.hookInstallFile(x, info)
return True
elif hooks_type == str:
for x in hooks:
if x in valid_hook:
self.hookInstallFile(x, info)
return True
return False
def hookUninstall(self, info):
@ -284,17 +283,17 @@ class plugins_api:
valid_list_hook = ['menu']
if 'hook' in info:
hooks = info['hook']
hooks_type = type(hooks)
if hooks_type == list:
for h in hooks:
for h in hooks:
hooks_type = type(h)
if hooks_type == dict:
tag = h['tag']
if tag in valid_list_hook:
self.hookUninstallFile(tag, h[tag])
elif hooks_type == str:
for x in hooks:
if x in valid_hook:
self.hookUninstallFile(x, info)
return True
elif hooks_type == str:
for x in hooks:
if x in valid_hook:
self.hookUninstallFile(x, info)
return True
return False
def uninstallOldApi(self):

@ -11,7 +11,7 @@
"checks":"server/backup_ftp",
"path": "server/backup_ftp",
"author":"midoks",
"home":"",
"home":"https://github.com/midoks/mdserver-web",
"date":"2022-10-23",
"pid": "4"
}

@ -219,7 +219,8 @@ def publicObject(toObject, func, action=None, get=None):
return mw.getJson(data)
except Exception as e:
# API发生错误记录
# print(traceback.print_exc())
if mw.isDebugMode():
print(traceback.print_exc())
data = {'msg': '访问异常:' + str(e) + '!', "status": False}
return mw.getJson(data)

Loading…
Cancel
Save