You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

76 lines
1.7 KiB
JavaScript

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import request from '@/utils/request.js'
// 取窗口号
export const takeTicket = (params = {}) => {
return request({
tag: 'pad.ticket',
path: '/take',
method: 'POST',
body: params
})
}
// 实名核验记录查询
export const searchTicketVerify = (params = {}) => {
return request({
tag: 'pad.ticket',
path: '/verify/search',
method: 'POST',
body: params
})
}
// 回签(复号)
export const resumeTicket = (params = {}) => {
return request({
tag: 'pad.ticket',
path: '/resume',
method: 'POST',
body: params
})
}
// 优先取号(插队票)
export const createJumpTicket = (params = {}) => {
return request({
tag: 'pad.ticket',
path: '/create-jump',
method: 'POST',
body: params
})
}
// 获取人脸照片pad.ticket -> GET /face/image/{uid}
export const getFaceImage = (uid) => {
const id = String(uid || '').trim()
if (!id) {
return Promise.reject(new Error('uid 不能为空'))
}
const requestParams = {
tag: 'pad.ticket',
path: `/face/image/${encodeURIComponent(id)}`,
method: 'GET',
query: {}
}
console.log('[face-image] 请求参数:', {
uid: id,
tag: requestParams.tag,
method: requestParams.method,
path: requestParams.path,
query: requestParams.query,
})
return request(requestParams)
.then((result) => {
console.log('[face-image] 返回值:', result)
try {
console.log('[face-image] 返回值 JSON:', JSON.stringify(result, null, 2))
} catch (error) {
console.log('[face-image] 返回值无法 JSON 序列化:', error)
}
return result
})
.catch((error) => {
console.log('[face-image] 请求失败:', error)
throw error
})
}