huqi 5 лет назад
Родитель
Сommit
09c00bbd2b

+ 25 - 5
o2web/source/x_desktop/js/base_simple_anonymous.js

@@ -78,11 +78,31 @@ o2.addReady(function () {
         if (layout.config.app_protocol === "auto") {
             layout.config.app_protocol = window.location.protocol;
         }
-        o2.xDesktop.getServiceAddress(layout.config, function (service, center) {
-            layout.serviceAddressList = service;
-            layout.centerServer = center;
-            if (callback) callback();
-        }.bind(this));
+
+        if (layout.config.configMapping && (layout.config.configMapping[window.location.host] || layout.config.configMapping[window.location.hostname])){
+            var mapping = layout.config.configMapping[window.location.host] || layout.config.configMapping[window.location.hostname];
+            if (mapping.servers){
+                layout.serviceAddressList = mapping.servers;
+                layout.desktop.serviceAddressList = mapping.servers;
+                if (mapping.center) center = (o2.typeOf(mapping.center)==="array") ? mapping.center[0] : mapping.center;
+                layout.centerServer = center;
+                layout.desktop.centerServer = center;
+                if (callback) callback();
+            }else{
+                if (mapping.center) layout.config.center = (o2.typeOf(mapping.center)==="array") ? mapping.center : [mapping.center];
+                o2.xDesktop.getServiceAddress(layout.config, function (service, center) {
+                    _setLayoutService(service, center);
+                    _loadProgressBar();
+                    if (callback) callback();
+                }.bind(this));
+            }
+        }else{
+            o2.xDesktop.getServiceAddress(layout.config, function (service, center) {
+                _setLayoutService(service, center);
+                _loadProgressBar();
+                if (callback) callback();
+            }.bind(this));
+        }
     };
 
     var _load = function () {

+ 1 - 1
o2web/source/x_desktop/js/oauth2.js

@@ -5,7 +5,7 @@ layout.addReady(function(){
         var _load = function(){
             var host = o2.Actions.getHost("x_organization_assemble_authentication");
             var url = host+"/x_organization_assemble_authentication/jaxrs/oauth/auth";
-            var toUri = new URI(url);
+            var toUri = new URI(o2.filterUrl(url));
             toUri.setData(uri.getData());
             toUri.go();
         };

+ 1 - 1
o2web/source/x_desktop/sso.html

@@ -5,7 +5,7 @@
     <meta charset="UTF-8">
     <title></title>
     <script src="../o2_core/o2.min.js"></script>
-    <script src="../o2_lib/Decimal.js"></script>
+    <script src="js/sso.min.js"></script>
     <script>
         o2.addReady(function(){
             o2.JSON.get("res/config/config.json", function(config){