This commit is contained in:
2025-06-30 14:47:52 +08:00
parent 73e3e7ab5b
commit edbe5ef579
2 changed files with 7 additions and 1 deletions
@@ -108,6 +108,11 @@ class ArticleController extends BaseController
{
try {
$request->setPost('user_id', $request->user['id']);
$protocol = $request->header('x-forwarded-proto',
isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? 'https' : 'http');
$domain = $protocol . '://' . $request->host();
$request->setPost('domain', $domain);
return $this->getService()->add($request->all())
? $this->successResponse()
: $this->errorResponse();