/*访问后台的代码*/
layui.define([], function(exports) {
	var api={
			updateRole:function(form,callback){
				Lib.submitForm("/GAA/role/update.json",form,{},callback)
			},
			addRole:function(form,callback){
				Lib.submitForm("/GAA/role/add.json",form,{},callback)
			},
			del:function(ids,callback){
				Common.post("/GAA/role/delete.json",{"ids":ids},function(){
					callback();
				})
			},
			queryFunctionByRole:function(roleId,callback){
				Common.post("/GAA/role/function/ids.json",{"roleId":roleId},function(data){
//					console.log('data = ' + data)
					callback(data);
				})
			},
			saveFunctions:function(roleId,ids){
				Common.post("/GAA/role/function/update.json",{"roleId":roleId,"ids":ids},function(data){
					Common.info("保存功能成功")
				})
			},
			saveDataAccess:function(roleId,fnId,accessType){
				Common.post("/GAA/role/function/updateDataAccess.json",{"roleId":roleId,"fnId":fnId,"accessType":accessType},function(data){
					Common.info("保存数据权限成功")
				})
			}
			
		
	};
	
	 exports('roleApi',api);
	
});