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',