Skip to content

Commit 445ffba

Browse files
committed
修复编辑用户积分无效的bug
1 parent c9038e7 commit 445ffba

File tree

1 file changed

+49
-1
lines changed

1 file changed

+49
-1
lines changed

extend.php

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
->serializeToForum('shebaoting-money.extra_char_points', 'shebaoting-money.extra_char_points'),
4646

4747
(new Extend\Event())
48-
->listen(Saving::class, [Listeners\GiveMoney::class, 'postWillBeSaved']) // 修改这里
48+
->listen(SavingPostEvent::class, [Listeners\GiveMoney::class, 'postWillBeSaved']) // 修改这里
4949
->listen(Posted::class, [Listeners\GiveMoney::class, 'postWasPosted'])
5050
->listen(PostRestored::class, [Listeners\GiveMoney::class, 'postWasRestored'])
5151
->listen(PostHidden::class, [Listeners\GiveMoney::class, 'postWasHidden'])
@@ -54,10 +54,58 @@
5454
->listen(DiscussionRestored::class, [Listeners\GiveMoney::class, 'discussionWasRestored'])
5555
->listen(DiscussionHidden::class, [Listeners\GiveMoney::class, 'discussionWasHidden'])
5656
->listen(DiscussionDeleted::class, [Listeners\GiveMoney::class, 'discussionWasDeleted'])
57+
->listen(Saving::class, [Listeners\GiveMoney::class, 'userWillBeSaved'])
5758
->listen(Registered::class, [Listeners\GiveMoney::class, 'userWasRegistered'])
5859
->listen(PostWasLiked::class, [Listeners\GiveMoney::class, 'postWasLiked'])
5960
->listen(PostWasUnliked::class, [Listeners\GiveMoney::class, 'postWasUnliked']),
6061

6162
(new Extend\Routes('api'))
6263
->get('/money-log', 'money.logs', UserMoneyLogsController::class)
6364
];
65+
66+
// $extend = [
67+
// (new Extend\Frontend('forum'))
68+
// ->js(__DIR__ . '/js/dist/forum.js')
69+
// ->css(__DIR__ . '/less/forum.less')
70+
// ->route('/money-log', 'user.money-log'),
71+
72+
// (new Extend\Frontend('admin'))
73+
// ->js(__DIR__ . '/js/dist/admin.js')
74+
// ->css(__DIR__ . '/less/admin.less'),
75+
76+
// new Extend\Locales(__DIR__ . '/locale'),
77+
78+
// (new Extend\ApiSerializer(UserSerializer::class))
79+
// ->attributes(AddUserMoneyAttributes::class),
80+
81+
// (new Extend\Settings())
82+
// ->serializeToForum('shebaoting-money.moneyname', 'shebaoting-money.moneyname')
83+
// ->serializeToForum('shebaoting-money.level_names', 'shebaoting-money.level_names')
84+
// ->serializeToForum('shebaoting-money.money_scale', 'shebaoting-money.money_scale')
85+
// ->serializeToForum('shebaoting-money.noshowzero', 'shebaoting-money.noshowzero'),
86+
87+
// (new Extend\Event())
88+
// ->listen(SavingPost::class, [Listeners\GiveMoney::class, 'postWillBeSaved'])
89+
// ->listen(SavingDiscussion::class, [Listeners\GiveMoney::class, 'discussionWillBeSaved'])
90+
// ->listen(Posted::class, [Listeners\GiveMoney::class, 'postWasPosted'])
91+
// ->listen(PostRestored::class, [Listeners\GiveMoney::class, 'postWasRestored'])
92+
// ->listen(PostHidden::class, [Listeners\GiveMoney::class, 'postWasHidden'])
93+
// ->listen(PostDeleted::class, [Listeners\GiveMoney::class, 'postWasDeleted'])
94+
// ->listen(Started::class, [Listeners\GiveMoney::class, 'discussionWasStarted'])
95+
// ->listen(DiscussionRestored::class, [Listeners\GiveMoney::class, 'discussionWasRestored'])
96+
// ->listen(DiscussionHidden::class, [Listeners\GiveMoney::class, 'discussionWasHidden'])
97+
// ->listen(DiscussionDeleted::class, [Listeners\GiveMoney::class, 'discussionWasDeleted'])
98+
// ->listen(Saving::class, [Listeners\GiveMoney::class, 'userWillBeSaved'])
99+
// ->listen(Registered::class, [Listeners\GiveMoney::class, 'userWasRegistered']),
100+
101+
// (new Extend\Routes('api'))
102+
// ->get('/money-log', 'money.logs', UserMoneyLogsController::class)
103+
// ];
104+
105+
// if (class_exists('Flarum\Likes\Event\PostWasLiked')) {
106+
// $extend[] =
107+
// (new Extend\Event())
108+
// ->listen(PostWasLiked::class, [Listeners\GiveMoney::class, 'postWasLiked'])
109+
// ->listen(PostWasUnliked::class, [Listeners\GiveMoney::class, 'postWasUnliked']);
110+
// }
111+
// return $extend;

0 commit comments

Comments
 (0)