Selaa lähdekoodia

Merge remote-tracking branch 'origin/dev' into dev

heqinwei 7 vuotta sitten
vanhempi
commit
5f2a52b69f
2 muutettua tiedostoa jossa 20 lisäystä ja 4 poistoa
  1. 12 3
      frontend/saas-web/app.json
  2. 8 1
      frontend/saas-web/overrides/data/Connection.js

+ 12 - 3
frontend/saas-web/app.json

@@ -296,7 +296,10 @@
         },*/
         "compressor":null,
         "server": {
-            "basePath": "http://192.168.0.181:8560",
+            "basePath": {
+                "https": "https://saas-api-dev.usoftchina.com:5443",
+                "http": "http://192.168.0.181:8560"
+            },
             "urlPattern": "^\/api\/"
         }
     },
@@ -306,7 +309,10 @@
      */
     "testing": {
         "server": {
-            "basePath": "http://192.168.0.181:8560",
+            "basePath": {
+                "https": "https://saas-api-dev.usoftchina.com:5443",
+                "http": "http://192.168.0.181:8560"
+            },
             "urlPattern": "^\/api\/"
         }
     },
@@ -319,7 +325,10 @@
             "delay": 250
         },
         "server": {
-            "basePath": "http://192.168.0.181:8560",
+            "basePath": {
+                "https": "https://saas-api-dev.usoftchina.com:5443",
+                "http": "http://192.168.0.181:8560"
+            },
             "urlPattern": "^\/api\/"
         }
     },

+ 8 - 1
frontend/saas-web/overrides/data/Connection.js

@@ -16,12 +16,19 @@ Ext.define('saas.override.data.Connection', {
     },
 
     privates: {
+        parseBasePath: function(basePath) {
+            if (Ext.isObject(basePath)) {
+                return basePath[window.location.protocol.split(":")[0]];
+            }
+            return basePath;
+        },
         setupServerOptions: function(options) {
             var serverOptions = Ext.manifest.server, originUrl = options.url;
             if (serverOptions && serverOptions.basePath && !this.urlRegexp.test(originUrl) &&
               (!serverOptions.urlPattern || new RegExp(serverOptions.urlPattern).test(originUrl))) {
                 Ext.Object.merge(options, {
-                    url: serverOptions.basePath + (originUrl.indexOf('/') == 0 ? '' : '/') + originUrl,
+                    url: this.parseBasePath(serverOptions.basePath)
+                        + (originUrl.indexOf('/') == 0 ? '' : '/') + originUrl,
                     headers: this.getDefaultServerHeaders() || {}
                 });
             }