Files
klp-oa/klp-ui/src/api/system/ocr.js

44 lines
955 B
JavaScript
Raw Normal View History

2025-08-02 13:38:04 +08:00
import request from '@/utils/request'
2025-08-02 16:13:13 +08:00
/**
* 调用ocr, 直接识别图像中的文字
*
* @param {string} imgUrl 图片url
* @returns {Promise<string>} 识别结果
*/
2025-08-02 13:38:04 +08:00
export function recognizeText({ imgUrl }) {
return request({
url: '/wms/purchasePlan/recognizeText',
method: 'post',
data: { imgUrl }
})
2025-08-02 16:13:13 +08:00
}
/**
* 调用通义千问模型, 识别图片中的文字
*
* @param {string} imageUrl 图片url
* @returns {Promise<string>} 识别结果
*/
export function recognizeBomByModel({ imageUrl }) {
return request({
url: '/wms/imageRecognition/recognize',
method: 'post',
data: { imageUrl },
timeout: 100000
})
2025-08-04 11:15:42 +08:00
}
/**
* 调用ocr, 识别pdf中的文字
*
* @param {string} imageUrl 图片url
* @returns {Promise<string>} 识别结果
*/
export function recognizePdfText({ pdfUrl }) {
return request({
url: '/wms/purchasePlan/recognizePdfText',
method: 'post',
data: { pdfUrl },
})
2025-08-02 13:38:04 +08:00
}