瀏覽代碼

!37 存在安全隐患
Merge pull request !37 from coffee/v6

在可以登录的前提并了解系统的提前下,确认可以修改权限,感谢反馈。

Anyon 2 年之前
父節點
當前提交
1cbc5c1f6d
共有 1 個文件被更改,包括 14 次插入1 次删除
  1. 14 1
      app/admin/controller/Index.php

+ 14 - 1
app/admin/controller/Index.php

@@ -77,7 +77,20 @@ class Index extends Controller
             }
         }
     }
-
+        /**
+     * 表单数据处理
+     * @param array $data
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
+     */
+    protected function _form_filter(array &$data)
+    {
+        if ($this->request->isPost()) {
+            unset($data['username']);
+            unset($data['authorize']);
+        }
+    }
     /**
      * 修改用户资料
      * @login true