feat: 完成三方平台发布管理

This commit is contained in:
augushong
2025-05-05 10:29:49 +08:00
parent d27772ef03
commit 70b17cbd10
8 changed files with 188 additions and 96 deletions

View File

@@ -0,0 +1,33 @@
<?php
namespace think\response;
use think\Response;
class Htmx extends Response
{
protected $triggerOptions = [];
public function addTrigger($name, $data = null)
{
$this->triggerOptions[$name] = $data;
return $this;
}
public function message($message)
{
$this->triggerOptions['layerMsg'] = ['type' => 1, 'title' => $message];
return $this;
}
protected function output($data)
{
$this->header([
'HX-Trigger' => json_encode($this->triggerOptions),
]);
return parent::output($data);
}
}