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

应用市场打开权限判断!

jyew2 5 лет назад
Родитель
Сommit
e7ab1074b3
1 измененных файлов с 27 добавлено и 22 удалено
  1. 27 22
      o2web/source/x_component_AppMarketV2/Main.js

+ 27 - 22
o2web/source/x_component_AppMarketV2/Main.js

@@ -15,7 +15,7 @@ MWF.xApplication.AppMarketV2.Main = new Class({
         "title": MWF.xApplication.AppMarketV2.LP.title,
         "minHeight": 700
     },
-    onQueryLoad: function(){
+    onQueryLoad: function(){		
         this.lp = MWF.xApplication.AppMarketV2.LP;
         this.actions = MWF.Actions.load("x_program_center");
 		this.viewPath = this.path+this.options.style+"/view.html";
@@ -34,27 +34,32 @@ MWF.xApplication.AppMarketV2.Main = new Class({
         }.bind(this));
     },
     loadApplication: function(callback){
-		this.content.loadHtml(this.viewPath, {"bind": {"lp": this.lp}, "module": this}, function(){
-			if (!this.options.isRefresh){
-				this.maxSize(function(){
-					//检查是否在云服务器上已注册
-					this.actions.CollectAction.login(//平台封装好的方法
-						function( json ){ //服务调用成功的回调函数, json为服务传回的数据
-							//alert(json.type)
-							if (json.type && json.type=="error"){
-								o2.xDesktop.notice("error", {x: "right", y:"top"}, json.message+"请至系统配置——云服务配置——连接配置注册并连接到O2云");
-							}
-							if (json.type && json.type=="success"){
-								this.loadApp(callback);
-							}
-						}.bind(this),null,false //同步执行 
-					);
-					
-				}.bind(this));
-			}else{
-				this.loadApp(callback);
-			}
-		}.bind(this));
+		if (MWF.AC.isAdministrator()){	//this.checkO2Collect();
+		
+			this.content.loadHtml(this.viewPath, {"bind": {"lp": this.lp}, "module": this}, function(){
+				if (!this.options.isRefresh){
+					this.maxSize(function(){
+						//检查是否在云服务器上已注册
+						this.actions.CollectAction.login(//平台封装好的方法
+							function( json ){ //服务调用成功的回调函数, json为服务传回的数据
+								//alert(json.type)
+								if (json.type && json.type=="error"){
+									o2.xDesktop.notice("error", {x: "right", y:"top"}, json.message+"请至系统配置——云服务配置——连接配置注册并连接到O2云");
+								}
+								if (json.type && json.type=="success"){
+									this.loadApp(callback);
+								}
+							}.bind(this),null,false //同步执行 
+						);
+						
+					}.bind(this));
+				}else{
+					this.loadApp(callback);
+				}
+			}.bind(this));
+		}else{
+			o2.xDesktop.notice("error", {x: "right", y:"top"}, "应用市场需要管理员角色才能访问");
+		}
 	},
 	loadApp: function(callback){
 		//this.initNode();