办公V3
This commit is contained in:
@@ -39,6 +39,30 @@ service.interceptors.request.use(config => {
|
||||
config.url = url;
|
||||
}
|
||||
if (!isRepeatSubmit && (config.method === 'post' || config.method === 'put')) {
|
||||
// 对于盖章请求,添加特殊处理确保 0 值不被过滤
|
||||
if (config.url && config.url.includes('/stamp/java')) {
|
||||
console.log('Stamp request - original data:', JSON.stringify(config.data, null, 2))
|
||||
if (config.data && typeof config.data === 'object') {
|
||||
// 确保 yPx 和 xPx 即使是 0 也被正确包含
|
||||
// 创建一个新对象,确保所有值都被正确设置
|
||||
const cleanData = {
|
||||
targetFileUrl: String(config.data.targetFileUrl || ''),
|
||||
stampImageUrl: String(config.data.stampImageUrl || ''),
|
||||
pageNo: Number(config.data.pageNo) || 1,
|
||||
xPx: Number(config.data.xPx) || 0,
|
||||
yPx: Number(config.data.yPx) || 0
|
||||
}
|
||||
if (config.data.widthPx !== undefined && config.data.widthPx !== null) {
|
||||
cleanData.widthPx = Number(config.data.widthPx)
|
||||
}
|
||||
if (config.data.heightPx !== undefined && config.data.heightPx !== null) {
|
||||
cleanData.heightPx = Number(config.data.heightPx)
|
||||
}
|
||||
console.log('Stamp request - cleaned data:', JSON.stringify(cleanData, null, 2))
|
||||
console.log('yPx in cleaned data:', cleanData.yPx, typeof cleanData.yPx)
|
||||
config.data = cleanData
|
||||
}
|
||||
}
|
||||
const requestObj = {
|
||||
url: config.url,
|
||||
data: typeof config.data === 'object' ? JSON.stringify(config.data) : config.data,
|
||||
|
||||
Reference in New Issue
Block a user