From 7f8e68bb0ad4ea382fd31fdf607afddf092f93f8 Mon Sep 17 00:00:00 2001 From: molong Date: Sat, 21 Feb 2026 10:35:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8D=95=E5=A4=8D=E6=95=B0?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Auth/Admin/Role.php | 6 +++--- app/Http/Controllers/Auth/Admin/User.php | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/Http/Controllers/Auth/Admin/Role.php b/app/Http/Controllers/Auth/Admin/Role.php index 583c545..34129f3 100644 --- a/app/Http/Controllers/Auth/Admin/Role.php +++ b/app/Http/Controllers/Auth/Admin/Role.php @@ -70,7 +70,7 @@ class Role extends Controller { $validated = $request->validate([ 'name' => 'required|string|max:50', - 'code' => 'required|string|max:50|unique:auth_roles,code', + 'code' => 'required|string|max:50|unique:auth_role,code', 'description' => 'nullable|string|max:200', 'sort' => 'nullable|integer|min:0', 'status' => 'nullable|integer|in:0,1', @@ -94,7 +94,7 @@ class Role extends Controller { $validated = $request->validate([ 'name' => 'nullable|string|max:50', - 'code' => 'nullable|string|max:50|unique:auth_roles,code,' . $id, + 'code' => 'nullable|string|max:50|unique:auth_role,code,' . $id, 'description' => 'nullable|string|max:200', 'sort' => 'nullable|integer|min:0', 'status' => 'nullable|integer|in:0,1', @@ -204,7 +204,7 @@ class Role extends Controller { $validated = $request->validate([ 'name' => 'required|string|max:50', - 'code' => 'required|string|max:50|unique:auth_roles,code', + 'code' => 'required|string|max:50|unique:auth_role,code', 'description' => 'nullable|string|max:200', 'sort' => 'nullable|integer|min:0', 'status' => 'nullable|integer|in:0,1', diff --git a/app/Http/Controllers/Auth/Admin/User.php b/app/Http/Controllers/Auth/Admin/User.php index 23ddaef..a08419a 100644 --- a/app/Http/Controllers/Auth/Admin/User.php +++ b/app/Http/Controllers/Auth/Admin/User.php @@ -60,10 +60,10 @@ class User extends Controller public function store(Request $request) { $validated = $request->validate([ - 'username' => 'required|string|max:50|unique:auth_users,username', + 'username' => 'required|string|max:50|unique:auth_user,username', 'password' => 'required|string|min:6', 'real_name' => 'required|string|max:50', - 'email' => 'nullable|email|unique:auth_users,email', + 'email' => 'nullable|email|unique:auth_user,email', 'phone' => 'nullable|string|max:20', 'department_id' => 'nullable|integer|exists:auth_departments,id', 'role_ids' => 'nullable|array', @@ -86,10 +86,10 @@ class User extends Controller public function update(Request $request, $id) { $validated = $request->validate([ - 'username' => 'nullable|string|max:50|unique:auth_users,username,' . $id, + 'username' => 'nullable|string|max:50|unique:auth_user,username,' . $id, 'password' => 'nullable|string|min:6', 'real_name' => 'nullable|string|max:50', - 'email' => 'nullable|email|unique:auth_users,email,' . $id, + 'email' => 'nullable|email|unique:auth_user,email,' . $id, 'phone' => 'nullable|string|max:20', 'avatar' => 'nullable|string|max:500', 'department_id' => 'nullable|integer|exists:auth_departments,id',