demo增加边扫边上传功能

This commit is contained in:
luoliangyi 2022-06-24 15:00:46 +08:00
parent 8b4aae4c0b
commit b3a929c4e5
1 changed files with 8 additions and 3 deletions

View File

@ -50,7 +50,8 @@
} }
else if ("upload_local_file" == message['func']) else if ("upload_local_file" == message['func'])
{ {
alert(msg.data); if (message['iden'] != "111")
alert(msg.data);
} }
else if ("merge_local_image" == message['func']) else if ("merge_local_image" == message['func'])
{ {
@ -170,9 +171,13 @@
req1.image_path = message['image_path']; req1.image_path = message['image_path'];
socket.send(JSON.stringify(req1)); socket.send(JSON.stringify(req1));
var req2 = {'func':'delete_local_file', 'file_path':''}; var req2 = {'func':'upload_local_file', 'iden':'111', 'file_path':'', 'upload_mode':'http', 'http_host':'192.168.100.148', 'http_port':8001};
req2.file_path = message['image_path']; req2.file_path = message['image_path'];
socket.send(JSON.stringify(req2)); socket.send(JSON.stringify(req2));
var req3 = {'func':'delete_local_file', 'file_path':''};
req3.file_path = message['image_path'];
socket.send(JSON.stringify(req3));
} }
else if ("stop_scan" == message['func']) else if ("stop_scan" == message['func'])
{ {
@ -330,7 +335,7 @@
{ {
socket.send(JSON.stringify({ socket.send(JSON.stringify({
'func':'set_global_config', 'func':'set_global_config',
'image_format':'bmp' 'image_format':'jpg'
})); }));
} }