dataLists(); } /** * @notes 添加管理员 * @return \think\response\Json * @author Tab * @date 2021/7/13 11:33 */ public function add() { $params = (new AdminValidate())->post()->goCheck('add'); AdminLogic::add($params); return $this->success('添加管理员成功'); } /** * @notes 编辑管理员 * @return \think\response\Json * @author Tab * @date 2021/7/13 11:41 */ public function edit() { $params = (new AdminValidate())->post()->goCheck('edit'); $result = AdminLogic::edit($params); if ($result) { return $this->success('编辑成功'); } return $this->fail(AdminLogic::getError()); } /** * @notes 删除管理员 * @return \think\response\Json * @author Tab * @date 2021/7/13 11:42 */ public function delete() { $params = (new AdminValidate())->post()->goCheck('delete'); $result = AdminLogic::delete($params); if ($result) { return $this->success('删除成功'); } return $this->fail(AdminLogic::getError()); } /** * @notes 查看管理员详情 * @return \think\response\Json * @author Tab * @date 2021/7/13 11:43 */ public function detail() { $params = (new AdminValidate())->goCheck('detail'); $result = AdminLogic::detail($params); return $this->data($result); } /** * @notes 获取管理员的基本信息 * @return \think\response\Json * @author cjhao * @date 2022/4/21 15:05 */ public function getAdminInfo() { $result = AdminLogic::getAdminInfo($this->adminId); return $this->data($result); } /** * @notes 修改管理员密码 * @return \think\response\Json * @author cjhao * @date 2022/4/21 15:16 * */ public function resetPassword(){ $params = (new ResetPasswordValidate())->post()->goCheck(null,['admin_id'=>$this->adminId]); $result = AdminLogic::resetPassword($params,$this->adminId); if(true === $result){ return $this->success('密码修改成功',[],1,1); } return $this->fail($result); } }