Files
tydata-admin/apps/web-antd/src/api/platform-user/index.ts
2026-02-02 14:55:34 +08:00

56 lines
1.1 KiB
TypeScript

import type { Recordable } from '@vben/types';
import { requestClient } from '#/api/request';
export namespace PlatformUserApi {
export interface PlatformUserItem {
id: number;
mobile: string;
nickname: string;
info: string;
inside: number;
disable: number; // 0 可用 1 禁用
create_time: string;
update_time: string;
}
export interface PlatformUserList {
total: number;
items: PlatformUserItem[];
}
export interface UpdatePlatformUserRequest {
mobile?: string;
nickname?: string;
info?: string;
inside?: number;
disable?: number; // 0 可用 1 禁用
}
}
/**
* 获取平台用户列表数据
*/
async function getPlatformUserList(params: Recordable<any>) {
return requestClient.get<PlatformUserApi.PlatformUserList>(
'/platform_user/list',
{
params,
},
);
}
/**
* 更新平台用户
* @param id 用户 ID
* @param data 用户数据
*/
async function updatePlatformUser(
id: number,
data: PlatformUserApi.UpdatePlatformUserRequest,
) {
return requestClient.put(`/platform_user/update/${id}`, data);
}
export { getPlatformUserList, updatePlatformUser };