|
|
@@ -24,6 +24,28 @@ class printUtil
|
|
|
$this->sn = $sn;
|
|
|
}
|
|
|
|
|
|
+ public function printLabelMsg($content)
|
|
|
+ {
|
|
|
+ $time = time(); //请求时间
|
|
|
+ $msgInfo = array(
|
|
|
+ 'user' => $this->user,
|
|
|
+ 'stime' => $time,
|
|
|
+ 'sig' => $this->signature($time),
|
|
|
+ 'apiname' => 'Open_printLabelMsg',
|
|
|
+ 'sn' => $this->sn,
|
|
|
+ 'content' => $content,
|
|
|
+ 'times' => $this->times//打印次数
|
|
|
+ );
|
|
|
+ $client = new \HttpClient(self::IP, self::PORT);
|
|
|
+ if (!$client->post(self::PATH, $msgInfo)) {
|
|
|
+ //echo 'error';
|
|
|
+ } else {
|
|
|
+ //服务器返回的JSON字符串,建议要当做日志记录起来
|
|
|
+ $result = $client->getContent();
|
|
|
+ //echo $result;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public function printMsg($content)
|
|
|
{
|
|
|
$time = time(); //请求时间
|