getNodeList(); $nodes = getTree(objToArray($nodes), false); json_return(200 , $nodes , 'success'); } // 添加节点 public function nodeAdd() { $param = input('post.'); $node = new NodeModel(); $flag = $node->insertNode($param); if($flag['code'] != 1){ return json(json_error_exception('1006',$flag['msg'])); } $this->removeRoleCache(); json_return(200,[],'success'); } // 删除节点 public function nodeDel() { $id = input('param.id'); $role = new NodeModel(); $flag = $role->delNode($id); if($flag['code'] != 1){ return json(json_error_exception('1006',$flag['msg'])); } $this->removeRoleCache(); json_return(200,[],'success'); } }