This is an automated email from the ASF dual-hosted git repository.

casion pushed a commit to branch dev-1.3.1
in repository https://gitbox.apache.org/repos/asf/incubator-linkis.git


The following commit(s) were added to refs/heads/dev-1.3.1 by this push:
     new fd591831f [BUG] improve code in EnginePluginRestful (#3913)
fd591831f is described below

commit fd591831f95da6b20ce6ebaa442767346303c327
Author: GuoPhilipse <[email protected]>
AuthorDate: Wed Nov 30 21:48:46 2022 +0800

    [BUG] improve code in EnginePluginRestful (#3913)
    
    * improve code in EnginePluginRestful
    
    * fix uploadEnginePluginBML-->updateEnginePluginBML
---
 .../linkis/engineplugin/server/restful/EnginePluginRestful.java   | 6 ++----
 .../src/apps/linkis/module/EnginePluginManagement/index.vue       | 8 ++++----
 linkis-web/src/apps/linkis/module/datasource/dataSourceApi.js     | 4 ++--
 3 files changed, 8 insertions(+), 10 deletions(-)

diff --git 
a/linkis-computation-governance/linkis-engineconn/linkis-engineconn-plugin-server/src/main/java/org/apache/linkis/engineplugin/server/restful/EnginePluginRestful.java
 
b/linkis-computation-governance/linkis-engineconn/linkis-engineconn-plugin-server/src/main/java/org/apache/linkis/engineplugin/server/restful/EnginePluginRestful.java
index ab37d77b2..77b16281e 100644
--- 
a/linkis-computation-governance/linkis-engineconn/linkis-engineconn-plugin-server/src/main/java/org/apache/linkis/engineplugin/server/restful/EnginePluginRestful.java
+++ 
b/linkis-computation-governance/linkis-engineconn/linkis-engineconn-plugin-server/src/main/java/org/apache/linkis/engineplugin/server/restful/EnginePluginRestful.java
@@ -167,9 +167,8 @@ public class EnginePluginRestful {
     } else if (StringUtils.isNotBlank(version)) {
       return Message.error("version cannot be null");
     }
-    file.getOriginalFilename().toLowerCase().endsWith(".zip");
     if (file.getOriginalFilename().toLowerCase().endsWith(".zip")) {
-      String username = ModuleUserUtils.getOperationUser(req, 
"uploadEnginePluginBML");
+      String username = ModuleUserUtils.getOperationUser(req, 
"updateEnginePluginBML");
       if (Configuration.isAdmin(username)) {
         log.info("{} start to update enginePlugin {} {}", username, ecType, 
version);
         try {
@@ -225,7 +224,6 @@ public class EnginePluginRestful {
   @RequestMapping(path = "/uploadEnginePluginBML", method = RequestMethod.POST)
   public Message uploadEnginePluginBML(
       @RequestParam("file") MultipartFile file, HttpServletRequest req) {
-    file.getOriginalFilename().toLowerCase().endsWith(".zip");
     if (file.getOriginalFilename().toLowerCase().endsWith(".zip")) {
       String username = ModuleUserUtils.getOperationUser(req, 
"uploadEnginePluginBML");
       if (Configuration.isAdmin(username)) {
@@ -237,7 +235,7 @@ public class EnginePluginRestful {
         }
         engineConnResourceService.refreshAll(true, false);
         log.info("{} finished to upload enginePlugin", username);
-        return Message.ok().data("mes", "upload file success");
+        return Message.ok().data("msg", "upload file success");
       } else {
         return Message.error("Only administrators can operate");
       }
diff --git a/linkis-web/src/apps/linkis/module/EnginePluginManagement/index.vue 
b/linkis-web/src/apps/linkis/module/EnginePluginManagement/index.vue
index 93179ff82..57f202aa0 100644
--- a/linkis-web/src/apps/linkis/module/EnginePluginManagement/index.vue
+++ b/linkis-web/src/apps/linkis/module/EnginePluginManagement/index.vue
@@ -328,9 +328,9 @@ export default {
       var formData = new FormData();
       if(this.actionNum === 0){
         formData.append('file', this.file);
-        api.fetch('/engineplugin/uploadEnginePluginBML', formData, {methed: 
'post', 'Content-Type': 'multipart/form-data'}).then(response => {
+        api.fetch('/engineplugin/uploadEnginePluginBML', formData, {method: 
'post', 'Content-Type': 'multipart/form-data'}).then(response => {
           console.log(response);
-          this.$Message.success(response.mes);
+          this.$Message.success(response.msg);
           this.getTypeList();
           this.showFileOperate = false;
         }).catch(e => {
@@ -343,8 +343,8 @@ export default {
         formData.append('file', this.file);
         formData.append('ecType', this.ecType);
         formData.append('version', this.version);
-        api.fetch('/engineplugin/updateEnginePluginBML', formData, {methed: 
'post', 'Content-Type': 'multipart/form-data'}).then(response => {
-          this.$Message.success(response.mes);
+        api.fetch('/engineplugin/updateEnginePluginBML', formData, {method: 
'post', 'Content-Type': 'multipart/form-data'}).then(response => {
+          this.$Message.success(response.msg);
           this.getTypeList();
           this.initECMList();
           this.showFileOperate = false;
diff --git a/linkis-web/src/apps/linkis/module/datasource/dataSourceApi.js 
b/linkis-web/src/apps/linkis/module/datasource/dataSourceApi.js
index 7fadb3d78..6274b2e9b 100644
--- a/linkis-web/src/apps/linkis/module/datasource/dataSourceApi.js
+++ b/linkis-web/src/apps/linkis/module/datasource/dataSourceApi.js
@@ -50,7 +50,7 @@ const createDataSource = (realFormData)=>{
  * @returns
  */
 const createDataSourceForm = (realFormData)=>{
-  return api.fetch('data-source-manager/info/form', realFormData, {methed: 
'post', 'Content-Type': 'text/plain'})
+  return api.fetch('data-source-manager/info/form', realFormData, {method: 
'post', 'Content-Type': 'text/plain'})
 }
 
 /**
@@ -78,7 +78,7 @@ const saveConnectParams = (datasourceId, data, comment)=>{
  */
 const saveConnectParamsForm = (datasourceId, data, comment)=>{
   const formData = serialize({connectParams: data, comment});
-  return api.fetch(`/data-source-manager/parameter/${datasourceId}/form`, 
formData, {methed: 'post', 'Content-Type': 'text/plain'})
+  return api.fetch(`/data-source-manager/parameter/${datasourceId}/form`, 
formData, {method: 'post', 'Content-Type': 'text/plain'})
 }
 
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to