Browse Source

no message

索隆 6 years ago
parent
commit
2c16c5100f
1 changed files with 6 additions and 6 deletions
  1. 6 6
      js/function.js

+ 6 - 6
js/function.js

@@ -41,24 +41,24 @@ function loginout(){
41 41
 }
42 42
 
43 43
 function getMenu(){
44
-	var openIndex = 0, data = {data:[{"name":"预测管理","parent_id":"0","url":"prediction.html"},{"name":"用户管理","parent_id":"0","url":"management.html"},{"name":"火钻管理","parent_id":"0","url":"pierer.html"}]};
44
+	var openIndex = 0, res = {data:[{"name":"预测管理","parent_id":"0","url":"prediction.html"},{"name":"用户管理","parent_id":"0","url":"management.html"},{"name":"火钻管理","parent_id":"0","url":"pierer.html"}]};
45 45
 	/*ajax({url:"api/?a=public&act=menu",data:{},callBack:function(res){
46 46
 		if(res.code == 1){*/
47
-			$.each(data,function(index, items){
47
+			$.each(res.data,function(index, items){
48 48
 				if(getPageName(items.url)){
49 49
 					openIndex = index;
50
-					data[index]['parentIndex'] = true;
50
+					res.data[index]['parentIndex'] = true;
51 51
 				}
52 52
 				if(items.list.length > 0){
53 53
 					$.each(items.list,function(i, item){
54 54
 						if(getPageName(item.url)){
55 55
 							openIndex = index;
56
-							data[index]['parentIndex'] = true;
57
-							data[index]['list'][i]['subIndex'] = true;
56
+							res.data[index]['parentIndex'] = true;
57
+							res.data[index]['list'][i]['subIndex'] = true;
58 58
 						}
59 59
 					});
60 60
 				}else
61
-					delete data[index]['list'];
61
+					delete res.data[index]['list'];
62 62
 			});
63 63
 			$("#menu").html($.Template7.renderTpl("menu_template",res));
64 64
 			$("#menu>li:eq("+openIndex+")>ul.contentTxt").removeClass("contentTxt");