From 8c5b32de9002a5be04c98e8b156b7b9c934877f2 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 30 Dec 2019 21:05:48 +0800 Subject: [PATCH] update --- LICENSE | 2 +- app/Console/Commands/ImportReset.php | 49 ------------------- app/Console/Commands/SendRemindMail.php | 6 ++- .../{SystemCache.php => V2boardCache.php} | 6 +-- app/Console/Kernel.php | 4 +- .../Controllers/Passport/CommController.php | 3 +- install.sql | 17 ++++++- .../views/mail/sendEmailVerify.blade.php | 11 +++++ .../views/mail/sendRemindExpire.blade.php | 11 +++++ .../views/mail/sendRemindTraffic.blade.php | 11 +++++ 10 files changed, 60 insertions(+), 60 deletions(-) delete mode 100644 app/Console/Commands/ImportReset.php rename app/Console/Commands/{SystemCache.php => V2boardCache.php} (91%) diff --git a/LICENSE b/LICENSE index 821cd683..8d238731 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2017-2019 Bruskyii Panda +Copyright (c) 2019 Tokumeikoi Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/app/Console/Commands/ImportReset.php b/app/Console/Commands/ImportReset.php deleted file mode 100644 index 3aaad0bc..00000000 --- a/app/Console/Commands/ImportReset.php +++ /dev/null @@ -1,49 +0,0 @@ -v2ray_uuid = Helper::guid(true); - $item->token = Helper::guid(); - $item->save(); - } - } -} diff --git a/app/Console/Commands/SendRemindMail.php b/app/Console/Commands/SendRemindMail.php index 39157d81..4e913148 100644 --- a/app/Console/Commands/SendRemindMail.php +++ b/app/Console/Commands/SendRemindMail.php @@ -54,7 +54,8 @@ class SendRemindMail extends Command 'subject' => '在' . config('v2board.app_name', 'V2board') . '的服务即将到期', 'template_name' => 'mail.sendRemindExpire', 'template_value' => [ - 'name' => config('v2board.app_name', 'V2Board') + 'name' => config('v2board.app_name', 'V2Board'), + 'url' => config('v2board.app_url') ] ]); } @@ -71,7 +72,8 @@ class SendRemindMail extends Command 'subject' => '在' . config('v2board.app_name', 'V2board') . '的流量使用已达到80%', 'template_name' => 'mail.sendRemindTraffic', 'template_value' => [ - 'name' => config('v2board.app_name', 'V2Board') + 'name' => config('v2board.app_name', 'V2Board'), + 'url' => config('v2board.app_url') ] ]); } diff --git a/app/Console/Commands/SystemCache.php b/app/Console/Commands/V2boardCache.php similarity index 91% rename from app/Console/Commands/SystemCache.php rename to app/Console/Commands/V2boardCache.php index a7a162f7..d296d701 100644 --- a/app/Console/Commands/SystemCache.php +++ b/app/Console/Commands/V2boardCache.php @@ -10,21 +10,21 @@ use App\Models\ServerLog; use App\Utils\Helper; use Illuminate\Support\Facades\Redis; -class SystemCache extends Command +class V2boardCache extends Command { /** * The name and signature of the console command. * * @var string */ - protected $signature = 'system:cache'; + protected $signature = 'v2board:cache'; /** * The console command description. * * @var string */ - protected $description = '系统缓存任务'; + protected $description = '缓存任务'; /** * Create a new command instance. diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 1f354193..4d7f19f3 100755 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -24,12 +24,12 @@ class Kernel extends ConsoleKernel */ protected function schedule(Schedule $schedule) { + // v2board + $schedule->command('v2board:cache')->hourly(); // check $schedule->command('check:order')->everyMinute(); $schedule->command('check:expire')->everyMinute(); $schedule->command('check:commission')->everyMinute(); - // system cache - $schedule->command('system:cache')->hourly(); // reset $schedule->command('reset:traffic')->monthlyOn(1, '00:00'); $schedule->command('reset:serverLog')->monthlyOn(1, '00:00'); diff --git a/app/Http/Controllers/Passport/CommController.php b/app/Http/Controllers/Passport/CommController.php index 9f1fe81b..6ba09566 100644 --- a/app/Http/Controllers/Passport/CommController.php +++ b/app/Http/Controllers/Passport/CommController.php @@ -38,7 +38,8 @@ class CommController extends Controller 'mail.sendEmailVerify', [ 'code' => $code, - 'name' => config('v2board.app_name', 'V2Board') + 'name' => config('v2board.app_name', 'V2Board'), + 'url' => config('v2board.app_url') ], function ($message) use($email, $subject) { $message->to($email)->subject($subject); diff --git a/install.sql b/install.sql index 5413eaee..6d62e19f 100644 --- a/install.sql +++ b/install.sql @@ -17,6 +17,19 @@ CREATE TABLE `v2_invite_code` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +DROP TABLE IF EXISTS `v2_mail_log`; +CREATE TABLE `v2_mail_log` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `email` varchar(64) NOT NULL, + `subject` varchar(255) NOT NULL, + `template_name` varchar(255) NOT NULL, + `error` varchar(255) DEFAULT NULL, + `created_at` int(11) NOT NULL, + `updated_at` int(11) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + DROP TABLE IF EXISTS `v2_notice`; CREATE TABLE `v2_notice` ( `id` int(11) NOT NULL AUTO_INCREMENT, @@ -74,8 +87,8 @@ DROP TABLE IF EXISTS `v2_server`; CREATE TABLE `v2_server` ( `id` int(11) NOT NULL AUTO_INCREMENT, `group_id` varchar(255) NOT NULL, - `parent_id` int(11) DEFAULT NULL, `name` varchar(255) CHARACTER SET utf8mb4 NOT NULL, + `parent_id` int(11) DEFAULT NULL, `host` varchar(255) NOT NULL, `port` int(11) NOT NULL, `server_port` int(11) NOT NULL, @@ -173,4 +186,4 @@ CREATE TABLE `v2_user` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- 2019-12-29 04:58:01 \ No newline at end of file +-- 2019-12-30 11:13:16 \ No newline at end of file diff --git a/resources/views/mail/sendEmailVerify.blade.php b/resources/views/mail/sendEmailVerify.blade.php index 47f29d22..67ac396d 100644 --- a/resources/views/mail/sendEmailVerify.blade.php +++ b/resources/views/mail/sendEmailVerify.blade.php @@ -59,6 +59,17 @@ + + + + + + +
+ 登录到{{$name}} +
+ + diff --git a/resources/views/mail/sendRemindExpire.blade.php b/resources/views/mail/sendRemindExpire.blade.php index 744684e4..233ebc6f 100644 --- a/resources/views/mail/sendRemindExpire.blade.php +++ b/resources/views/mail/sendRemindExpire.blade.php @@ -54,6 +54,17 @@ + + + + + + +
+ 登录到{{$name}} +
+ + diff --git a/resources/views/mail/sendRemindTraffic.blade.php b/resources/views/mail/sendRemindTraffic.blade.php index 57b180f3..957f71e7 100644 --- a/resources/views/mail/sendRemindTraffic.blade.php +++ b/resources/views/mail/sendRemindTraffic.blade.php @@ -54,6 +54,17 @@ + + + + + + +
+ 登录到{{$name}} +
+ +