This commit is contained in:
root 2019-12-30 21:05:48 +08:00
parent 0b89446b63
commit 8c5b32de90
10 changed files with 60 additions and 60 deletions

View File

@ -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

View File

@ -1,49 +0,0 @@
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use App\Models\User;
use App\Utils\Helper;
class ImportReset extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'import:reset';
/**
* The console command description.
*
* @var string
*/
protected $description = '为导入用户重置所有uuid及token';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$user = User::all();
foreach ($user as $item) {
$item->v2ray_uuid = Helper::guid(true);
$item->token = Helper::guid();
$item->save();
}
}
}

View File

@ -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')
]
]);
}

View File

@ -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.

View File

@ -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');

View File

@ -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);

View File

@ -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
-- 2019-12-30 11:13:16

View File

@ -59,6 +59,17 @@
</tr>
<tr>
<td style="padding:0 0 27px;">
<table cellpadding="0" cellspacing="0" align="center" style="margin:0 auto !important;">
<tbody><tr>
<td style="font:14px/16px Open Sans, Arial, Verdana, sans-serif; color:#fff; mso-padding-alt:12px 18px; border-radius:5px;" bgcolor="#05365d">
<a target="_blank" style="text-decoration:none; color:#fff; display:block; padding:12px 18px;" href="{{$url}}">登录到{{$name}}</a>
</td>
</tr>
</tbody></table>
</td>
</tr>

View File

@ -54,6 +54,17 @@
</tr>
<tr>
<td style="padding:0 0 27px;">
<table cellpadding="0" cellspacing="0" align="center" style="margin:0 auto !important;">
<tbody><tr>
<td style="font:14px/16px Open Sans, Arial, Verdana, sans-serif; color:#fff; mso-padding-alt:12px 18px; border-radius:5px;" bgcolor="#05365d">
<a target="_blank" style="text-decoration:none; color:#fff; display:block; padding:12px 18px;" href="{{$url}}">登录到{{$name}}</a>
</td>
</tr>
</tbody></table>
</td>
</tr>

View File

@ -54,6 +54,17 @@
</tr>
<tr>
<td style="padding:0 0 27px;">
<table cellpadding="0" cellspacing="0" align="center" style="margin:0 auto !important;">
<tbody><tr>
<td style="font:14px/16px Open Sans, Arial, Verdana, sans-serif; color:#fff; mso-padding-alt:12px 18px; border-radius:5px;" bgcolor="#05365d">
<a target="_blank" style="text-decoration:none; color:#fff; display:block; padding:12px 18px;" href="{{$url}}">登录到{{$name}}</a>
</td>
</tr>
</tbody></table>
</td>
</tr>