2026-08-31 14:49:28 +08:00
|
|
|
|
import type { ApiResponse } from "@/lib/api"
|
|
|
|
|
|
import type { UserItem, UserQueryParams } from "@/lib/models/user"
|
2026-09-04 13:21:47 +08:00
|
|
|
|
import { callByUser, callPublic } from "./base"
|
2026-08-31 14:49:28 +08:00
|
|
|
|
|
|
|
|
|
|
// ==================== 用户管理(.NET /api/baseinfo/v1/user/*) ====================
|
|
|
|
|
|
|
|
|
|
|
|
export async function fetchUserPage(
|
|
|
|
|
|
params: UserQueryParams,
|
|
|
|
|
|
): Promise<ApiResponse<UserItem[]>> {
|
|
|
|
|
|
return await callByUser<UserItem[]>(
|
|
|
|
|
|
"/api/baseinfo/v1/user/Page",
|
|
|
|
|
|
params,
|
|
|
|
|
|
"GET",
|
|
|
|
|
|
)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export async function fetchUserSearch(
|
|
|
|
|
|
params: UserQueryParams,
|
|
|
|
|
|
): Promise<ApiResponse<UserItem[]>> {
|
|
|
|
|
|
return await callByUser<UserItem[]>(
|
|
|
|
|
|
"/api/baseinfo/v1/user/Search",
|
|
|
|
|
|
params,
|
|
|
|
|
|
"GET",
|
|
|
|
|
|
)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export async function fetchAmountDetails(
|
|
|
|
|
|
params: Record<string, unknown>,
|
|
|
|
|
|
): Promise<ApiResponse<Record<string, unknown>>> {
|
|
|
|
|
|
return await callByUser<Record<string, unknown>>(
|
|
|
|
|
|
"/api/baseinfo/v1/user/AmountDetails",
|
|
|
|
|
|
params,
|
|
|
|
|
|
"GET",
|
|
|
|
|
|
)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export async function updateUserProfile(
|
|
|
|
|
|
data: Record<string, unknown>,
|
|
|
|
|
|
): Promise<ApiResponse<undefined>> {
|
|
|
|
|
|
return await callByUser<undefined>(
|
|
|
|
|
|
"/api/baseinfo/v1/user/UpdateProfile",
|
|
|
|
|
|
data,
|
|
|
|
|
|
)
|
|
|
|
|
|
}
|
2026-09-04 13:21:47 +08:00
|
|
|
|
|
|
|
|
|
|
// ==================== 个人中心资料/密码(.NET /user/*,cookie 会话) ====================
|
|
|
|
|
|
|
|
|
|
|
|
export async function updateUserInfo(data: {
|
|
|
|
|
|
QQ: string
|
|
|
|
|
|
Wx: string
|
2026-09-08 16:19:40 +08:00
|
|
|
|
// TaoBao: string
|
2026-09-04 13:21:47 +08:00
|
|
|
|
Email: string
|
|
|
|
|
|
}): Promise<ApiResponse<undefined>> {
|
|
|
|
|
|
return await callPublic<undefined>("/user/UpdateInfo", data)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export async function updateUserPwd(data: {
|
|
|
|
|
|
OldPwd: string
|
|
|
|
|
|
NewPwd: string
|
|
|
|
|
|
ConfirmPwd: string
|
|
|
|
|
|
}): Promise<ApiResponse<undefined>> {
|
|
|
|
|
|
return await callPublic<undefined>("/user/UpdatePwd", data)
|
|
|
|
|
|
}
|