Skip to content

Commit

Permalink
refactor(签到): 重构签到在启动信息的配置,修复签到后台配置后启动接口不生效问题
Browse files Browse the repository at this point in the history
  • Loading branch information
medz committed Nov 28, 2018
1 parent cc8b06c commit 08b2b9b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ class HomeController
public function index()
{
return view('plus-checkin::admin', [
'switch' => setting('checkin', 'switch'),
'balance' => setting('checkin', 'attach-balance'),
'switch' => setting('checkin', 'switch', true),
'balance' => setting('checkin', 'attach-balance', 1),
]);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@

namespace SlimKit\PlusCheckIn\Providers;

use function Zhiyi\Plus\setting;
use Illuminate\Support\ServiceProvider;
use Zhiyi\Plus\Support\ManageRepository;
use Zhiyi\Plus\Support\BootstrapAPIsEventer;
use Illuminate\Contracts\Config\Repository as ConfigRepository;

class RouteServiceProvider extends ServiceProvider
{
Expand All @@ -41,8 +41,10 @@ public function boot()
// Register Bootstraper API event.
$this->app->make(BootstrapAPIsEventer::class)->listen('v2', function () {
return [
'checkin' => (bool) $this->app->make(ConfigRepository::class)->get('checkin.open'),
'checkin:attach_balance' => (int) $this->app->make(ConfigRepository::class)->get('checkin.attach_balance'),
'checkin' => [
'switch' => setting('checkin', 'switch', true),
'balance' => setting('checkin', 'attach-balance', 1),
],
];
});

Expand Down

0 comments on commit 08b2b9b

Please sign in to comment.