Procházet zdrojové kódy

打印服务测试

ajun před 5 roky
rodič
revize
126d76aabc

+ 3 - 2
app/Http/Controllers/PrintPartController.php

@@ -49,10 +49,11 @@ class PrintPartController extends Controller
         $content = $file->getContent();
         $content = base64_encode($content);
         $files = $request->file("blobs");
+
         $content = [
             "type" => "print",
-            "aliasName"=>"test",
-            "printerName"=>"打印机1",
+            "aliasName"=>"admin",
+            "printerName"=>"admin123",
             "content" => $content
         ];
         if(!$files)return Http::post("http://127.0.0.1:3000",$content);

+ 13 - 0
app/Http/Controllers/TestController.php

@@ -1574,4 +1574,17 @@ where (commodities.owner_id,commodity_barcodes.code) in (select commodities.owne
         return (new PrintPartController())->print($request);
     }
 
+    public function testSendCon(Request $request)
+    {
+        $content = [
+            "type" => "getClients",
+            "aliasName" => "test",
+            "printerName" => "打印机5",
+        ];
+        $post = Http::post("http://127.0.0.1:3000", $content);
+        $body = json_decode($post->body(),true);
+        $body['msg'] = json_decode($body['msg'],true);
+        dd(json_decode($post->body()),$post->body(),$body);
+    }
+
 }