Просмотр исходного кода

Merge branch 'feature/request_path_redirect' into 'develop'

websocket路径转发修正

See merge request o2oa/o2oa!614
胡起 5 лет назад
Родитель
Сommit
5378881bb3

+ 2 - 3
o2web/source/o2_core/o2/xDesktop/WebSocket.js

@@ -12,8 +12,6 @@ MWF.xDesktop.WebSocket = new Class({
         var wsScheme = (scheme.toString().toLowerCase()==="https") ? "wss" : "ws";
         this.ws = wsScheme+"://"+addressObj.host+(addressObj.port==80 ? "" : ":"+addressObj.port)+addressObj.context+"/ws/collaboration";
 
-
-
         this.reConnect = true;
         this.checking = false;
         this.heartTimeout = 60000;
@@ -22,7 +20,6 @@ MWF.xDesktop.WebSocket = new Class({
         this.maxErrorCount = 10;
         this.errorCount = 0;
 
-
         // var addressObj = layout.desktop.serviceAddressList["x_collaboration_assemble_websocket"];
         // this.ws = "ws://"+addressObj.host+(addressObj.port==80 ? "" : ":"+addressObj.port)+addressObj.context+"/ws/collaboration";
         //var ws = "ws://hbxa01.bf.ctc.com/x_collaboration_assemble_websocket/ws/collaboration";
@@ -42,9 +39,11 @@ MWF.xDesktop.WebSocket = new Class({
 
         this.connect();
     },
+
     connect: function(){
         if (layout.config.webSocketEnable){
             var ws = this.ws+"?x-token="+encodeURIComponent(Cookie.read("x-token"));
+            ws = o2.filterUrl(ws);
 
             try{
                 this.webSocket = new WebSocket(ws);

+ 1 - 1
o2web/source/x_component_cms_FormDesigner/Module/Form.js

@@ -193,7 +193,7 @@ MWF.xApplication.cms.FormDesigner.Module.Form = MWF.CMSFCForm = new Class({
 			if (callback) callback(this.dataTemplate[className]);
 		}else{
 			var path = MWF.CMSFD.ResetTemplateModules.indexOf( className.toLowerCase() ) != -1 ? "x_component_cms_FormDesigner" : "x_component_process_FormDesigner";
-			var templateUrl = "/"+path+"/Module/"+className+"/template.json";
+			var templateUrl = "../"+path+"/Module/"+className+"/template.json";
 			MWF.getJSON(templateUrl, function(responseJSON, responseText){
 				this.dataTemplate[className] = responseJSON;
 				if (callback) callback(responseJSON);