feat: enhance user management and pagination features #518
- Updated GetAllUsers function to return total user count along with paginated results, improving data handling in user retrieval. - Modified GetAllUsers API endpoint to accept page size as a parameter, allowing for dynamic pagination. - Enhanced UsersTable component to support customizable page sizes and improved pagination logic. - Added error handling for empty username and password in AddUser component. - Updated LogsTable component to display pagination information in a user-friendly format.
This commit is contained in:
@@ -19,7 +19,11 @@ const AddUser = (props) => {
|
||||
|
||||
const submit = async () => {
|
||||
setLoading(true);
|
||||
if (inputs.username === '' || inputs.password === '') return;
|
||||
if (inputs.username === '' || inputs.password === '') {
|
||||
setLoading(false);
|
||||
showError('用户名和密码不能为空!');
|
||||
return;
|
||||
}
|
||||
const res = await API.post(`/api/user/`, inputs);
|
||||
const { success, message } = res.data;
|
||||
if (success) {
|
||||
|
||||
Reference in New Issue
Block a user