Skip to content

Commit

Permalink
Fix:修复不能发布评论的Bug
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuchunshu committed Aug 1, 2023
1 parent 38482a4 commit c928314
Showing 1 changed file with 23 additions and 0 deletions.
@@ -1,2 +1,25 @@
<?php

declare(strict_types=1);
/**
* This file is part of zhuchunshu.
* @link https://github.com/zhuchunshu
* @document https://github.com/zhuchunshu/SForum
* @contact laravel@88.com
* @license https://github.com/zhuchunshu/SForum/blob/master/LICENSE
*/
namespace App\Plugins\Comment\src\Handler\Middleware\Create\Topic;

use App\Plugins\Topic\src\Handler\Topic\Middleware\MiddlewareInterface;

class EndMiddleware implements MiddlewareInterface
{
public function handler($data, \Closure $next)
{
// 评论发表成功
// 添加发表成功事件
EventDispatcher()->dispatch(new \App\Plugins\User\src\Event\Task\Daily\CreateTopicComment($data['comment']['id']));

return redirect()->url('/' . $data['topic_id'] . '.html/' . $data['comment']['id'] . '?page=' . get_topic_comment_page($data['comment']['id']) . '&clean_topic_comment_content_cache=create_topic_comment_' . $data['topic_id'])->with('success', '发表成功!')->go();
}
}

0 comments on commit c928314

Please sign in to comment.