import request from "@/utils/request"
import requestOld from "@/utils/requestOld"


// 百旺token
export async function handleGetBWTokenFun(params?: any) {
    const data = await request.get('/baiwang/auth/token', { params })
    return data
}

// 拿到人脸认证的二维码
export async function handleGetCertifyQrcode(code?: any, params?: any) {
    const data = await request.post(`/baiwang/auth/certify-qrcode/${code}`, params)
    return data
}

// 人脸认证的试试状态
export async function handleGetCertifyQrcodeResult(code?: any, params?: any) {
    const data = await request.post(`/baiwang/auth/certify-result/${code}`, params)
    return data
}

// 发票列表查询
export async function handleGetInvoicePageTable(code?: any, params?: any) {
    const data = await request.post(`/api/baiwang/invoice/query-page/${code}`, params)
    return data
}


// 获得百旺指定的配置
export async function handleGetInvoiceDetail(code?: any) {
    const data = await request.get(`/baiwang-config/${code}`)
    return data
}

// 百旺的发票交付接口
export async function handleGetDeliver(code?: any, params?: any) {
    const data = await request.post(`/api/baiwang/invoice/push/${code}`, params)
    return data
}

// 百旺的发票作废接口
export async function handleCancel(code?: any, params?: any) {
    const data = await request.post(`/api/baiwang/invoice/invalid/${code}`, params)
    return data
}

// 用地址栏传入的加密用户id去查询用户详情
export async function handleGetUserInfoById(params: any) {
    const data = await requestOld.get(`/Logging/GetPassportInfoById?UserIdEncrypted=${params.UserIdEncrypted}`, params)
    return data
}
