|
@@ -149,7 +149,7 @@ public class MagicWorkbenchController extends MagicController implements MagicEx
|
|
|
@GetMapping("/plugins")
|
|
|
@Valid(requireLogin = false)
|
|
|
@ResponseBody
|
|
|
- public JsonBean<List<Plugin>> plugins(){
|
|
|
+ public JsonBean<List<Plugin>> plugins() {
|
|
|
return new JsonBean<>(plugins);
|
|
|
}
|
|
|
|
|
@@ -265,7 +265,9 @@ public class MagicWorkbenchController extends MagicController implements MagicEx
|
|
|
public JsonBean<Boolean> upload(MultipartFile file, String mode, HttpServletRequest request) throws IOException {
|
|
|
notNull(file, FILE_IS_REQUIRED);
|
|
|
isTrue(allowVisit(request, Authorization.UPLOAD), PERMISSION_INVALID);
|
|
|
- configuration.getMagicBackupService().doBackupAll("上传前,系统自动全量备份", WebUtils.currentUserName());
|
|
|
+ if (configuration.getMagicBackupService() != null) {
|
|
|
+ configuration.getMagicBackupService().doBackupAll("上传前,系统自动全量备份", WebUtils.currentUserName());
|
|
|
+ }
|
|
|
return new JsonBean<>(magicAPIService.upload(file.getInputStream(), mode));
|
|
|
}
|
|
|
|
|
@@ -288,7 +290,9 @@ public class MagicWorkbenchController extends MagicController implements MagicEx
|
|
|
notNull(file, SIGN_IS_INVALID);
|
|
|
byte[] bytes = IoUtils.bytes(file.getInputStream());
|
|
|
isTrue(sign.equals(SignUtils.sign(timestamp, secretKey, mode, bytes)), SIGN_IS_INVALID);
|
|
|
- configuration.getMagicBackupService().doBackupAll("推送前,系统自动全量备份", WebUtils.currentUserName());
|
|
|
+ if (configuration.getMagicBackupService() != null) {
|
|
|
+ configuration.getMagicBackupService().doBackupAll("推送前,系统自动全量备份", WebUtils.currentUserName());
|
|
|
+ }
|
|
|
magicAPIService.upload(new ByteArrayInputStream(bytes), mode);
|
|
|
return new JsonBean<>();
|
|
|
}
|