多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
## 代码 ``` <?php namespace app\agent\controller; use think\Controller; use think\Db; class RbacController extends Controller { /** * 编辑角色提交 */ public function roleEditPost() { $id = $this->request->param("id", 0, 'intval'); if ($id == 1) { $this->error("超级管理员角色不能被修改!"); } if ($this->request->isPost()) { $data = $this->request->param(); $result = $this->validate($data, 'role'); if ($result !== true) { // 验证失败 输出错误信息 $this->error($result); } else { if (Db::name('role')->update($data) !== false) { $this->success("保存成功!", url('rbac/index')); } else { $this->error("保存失败!"); } } } } } ```