import {get, post} from '../request.js' const prefix = 'user' /** * 登录 * @param credentials * @returns {Promise>} */ export function loginApi(credentials) { return post('login', credentials) } /** * 注册 * @param credentials * @returns {Promise>} */ export function registerApi(credentials) { return post('register', credentials) } /** * 获取用户列表 * @param credentials * @returns {Promise>} */ export function userListApi(credentials) { return get(`${prefix}/list`, credentials) } /** * 获取当前登录用户信息 * @param credentials * @returns {Promise>} */ export function userMyInfoApi(credentials) { return get(`${prefix}/my-info`, credentials) } /** * 获取用户统计信息 * @param credentials * @returns {Promise>} */ export function userStatsApi(credentials) { return get(`${prefix}/user-stats`, credentials) } /** * 创建用户 * @param credentials * @returns {Promise>} */ export function createUserApi(credentials) { return post(`${prefix}/create`, credentials) } /** * 更新用户 * @param credentials * @returns {Promise>} */ export function updateUserApi(credentials) { return post(`${prefix}/update`, credentials) } /** * 删除用户 * @param credentials * @returns {Promise>} */ export function deleteUserApi(credentials) { return post(`${prefix}/delete`, credentials) } /** * 重置密码 * @param credentials * @returns {Promise>} */ export function resetPasswordApi(credentials) { return post(`${prefix}/reset-password`, credentials) } /** * 重置密码 * @param credentials * @returns {Promise>} */ export function changePasswordApi(credentials) { return post(`${prefix}/change-password`, credentials) }