import config from '@/config'
import request from '@/utils/request'

// 登录
export function login(params: Record<string, any>) {
    return request.post({ url: '/login/account', params: { ...params, terminal: config.terminal } })
}

// 退出登录
export function logout() {
    return request.post({ url: '/login/logout' })
}
export function setPurchaseFunds(params: any) {
    return request.post({ url: '/user/user/setPurchaseFunds', params })
}
export function setnowMoney(params: any) {
    return request.post({ url: '/user/user/setnowMoney', params })
}

// 用户信息
export function getUserInfo() {
    return request.get({ url: '/auth/admin/mySelf' })
}

// 编辑管理员信息
export function setUserInfo(params: any) {
    return request.post({ url: '/auth/admin/editSelf', params })
}

// 用户表列表
export function apiUserLists(params: any) {
    return request.get({ url: '/user/user/lists', params })
}

// 添加用户表
export function apiUserAdd(params: any) {
    return request.post({ url: '/user/user/add', params })
}

// 编辑用户表
export function apiUserEdit(params: any) {
    return request.post({ url: '/user/user/edit', params })
}

// 删除用户表
export function apiUserDelete(params: any) {
    return request.post({ url: '/user/user/delete', params })
}

// 用户表详情
export function apiUserDetail(params: any) {
    return request.get({ url: '/user/user/detail', params })
}

//  用户采购款明细、余额明细、礼品券明细、返还金明细 type 1,2,3,4(用户采购款明细、余额明细、礼品券明细、返还金明细)
export function apiUserFoundList(params: any) {
    return request.get({ url: '/user/user/fundList', params })
}

//  冻结礼品券
export function apiUserSingList(params: any) {
    return request.get({ url: '/user/user/userSing', params })
}

//  领取礼品列表
export function apiUserGiftList(params: any) {
    return request.get({ url: '/user/user/userGiftList', params })
}
