Browse Source

增加通过URL传入参数,在桌面模式直接打开指定应用的功能。app=appName&option={}&default=false

huqi 5 years ago
parent
commit
f8a5625538
1 changed files with 19 additions and 1 deletions
  1. 19 1
      o2web/source/o2_core/o2/xDesktop/Layout.js

+ 19 - 1
o2web/source/o2_core/o2/xDesktop/Layout.js

@@ -191,7 +191,25 @@ MWF.xDesktop.Layout = new Class({
         this.currentApp = null;
         this.session = {};
 
-        this.status = layout.userLayout;
+        var uri = new URI(window.location.href);
+        var df = uri.getData("default") || "";
+        this.noDefault = df.toString().toLowerCase()==="false";
+        var appNames = uri.getData("app");
+        var optionsStr = uri.getData("option");
+        var options = (optionsStr) ? JSON.decode(optionsStr) : null;
+        if (appNames){
+            this.status = layout.userLayout;
+            this.status.apps = {};
+            this.status.apps[appNames] = options || {};
+            this.status.apps[appNames].name = appNames;
+            this.status.apps[appNames].appId = appNames;
+            this.status.apps[appNames].window={"isMax": true, "isHide": false};
+            this.status.currentApp = appNames;
+        }else{
+            this.status = layout.userLayout;
+        }
+
+        //this.status = layout.userLayout;
         this.session.user = layout.session.user
         this.serviceAddressList = layout.serviceAddressList;
         this.centerServer = layout.centerServer;