Update api.js
This commit is contained in:
1 parent
5f274c2d86
commit
77e5c8c3ba
1 file changed
+4
-4
@@ -128,12 +128,12 @@ const API = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
// ============================================================
|
// ============================================================
|
||||||
// 用户管理
|
// 用户管理(支持分页和搜索)
|
||||||
// ============================================================
|
// ============================================================
|
||||||
async getUsers() {
|
async getUsers(page = 1, limit = 20, search = '') {
|
||||||
const data = await apiFetch('/users');
|
const data = await apiFetch('/users?page=' + page + '&limit=' + limit + '&search=' + encodeURIComponent(search));
|
||||||
if (data.error) throw new Error(data.error);
|
if (data.error) throw new Error(data.error);
|
||||||
return data || [];
|
return data;
|
||||||
},
|
},
|
||||||
|
|
||||||
async updateUserRole(userId, role) {
|
async updateUserRole(userId, role) {
|
||||||
|
|||||||
Reference in new issue
Block a user