Browse Source

添加Bark

整合 推送通知功能;
优化、简化系统设置选项;
兔姬桑 5 years ago
parent
commit
5689018af0
50 changed files with 553 additions and 457 deletions
  1. 0 31
      app/Components/Callback.php
  2. 9 8
      app/Components/Helpers.php
  3. 3 3
      app/Components/Namesilo.php
  4. 83 0
      app/Components/PushNotification.php
  5. 0 64
      app/Components/ServerChan.php
  6. 19 3
      app/Console/Commands/AutoJob.php
  7. 2 2
      app/Console/Commands/AutoReportNode.php
  8. 3 3
      app/Console/Commands/DailyJob.php
  9. 8 8
      app/Console/Commands/NodeBlockedDetection.php
  10. 2 2
      app/Console/Commands/UserExpireAutoWarning.php
  11. 3 3
      app/Console/Commands/UserTrafficAbnormalAutoWarning.php
  12. 1 1
      app/Console/Commands/UserTrafficAutoWarning.php
  13. 38 26
      app/Http/Controllers/AdminController.php
  14. 53 41
      app/Http/Controllers/AuthController.php
  15. 6 6
      app/Http/Controllers/TicketController.php
  16. 6 6
      app/Http/Controllers/UserController.php
  17. 0 43
      app/Http/Models/EmailLog.php
  18. 43 0
      app/Http/Models/NotificationLog.php
  19. 2 2
      app/Mail/activeUser.php
  20. 2 2
      app/Mail/closeTicket.php
  21. 2 2
      app/Mail/newTicket.php
  22. 2 2
      app/Mail/nodeCrashWarning.php
  23. 2 2
      app/Mail/replyTicket.php
  24. 2 2
      app/Mail/resetPassword.php
  25. 2 2
      app/Mail/sendUserInfo.php
  26. 2 2
      app/Mail/sendVerifyCode.php
  27. 2 2
      app/Mail/userExpireWarning.php
  28. 2 2
      app/Mail/userExpireWarningToday.php
  29. 2 2
      app/Mail/userTrafficWarning.php
  30. 25 25
      composer.lock
  31. 5 5
      resources/views/admin/layouts.blade.php
  32. 3 3
      resources/views/admin/notificationLog.blade.php
  33. 156 102
      resources/views/admin/system.blade.php
  34. 3 3
      resources/views/auth/activeUser.blade.php
  35. 20 20
      resources/views/auth/register.blade.php
  36. 1 1
      resources/views/emails/activeUser.blade.php
  37. 1 1
      resources/views/emails/closeTicket.blade.php
  38. 1 1
      resources/views/emails/newTicket.blade.php
  39. 2 2
      resources/views/emails/nodeCrashWarning.blade.php
  40. 1 1
      resources/views/emails/replyTicket.blade.php
  41. 1 1
      resources/views/emails/sendUserInfo.blade.php
  42. 1 1
      resources/views/emails/sendVerifyCode.blade.php
  43. 1 1
      resources/views/emails/userExpireWarning.blade.php
  44. 1 1
      resources/views/emails/userExpireWarningToday.blade.php
  45. 1 1
      resources/views/emails/userTrafficWarning.blade.php
  46. 4 4
      resources/views/user/layouts.blade.php
  47. 0 1
      resources/views/user/services.blade.php
  48. 2 1
      routes/web.php
  49. 11 10
      sql/db.sql
  50. 12 0
      sql/mod/20200412.sql

+ 0 - 31
app/Components/Callback.php

@@ -6,16 +6,12 @@ use App\Http\Models\Goods;
 use App\Http\Models\GoodsLabel;
 use App\Http\Models\Order;
 use App\Http\Models\Payment;
-use App\Http\Models\SsNode;
-use App\Http\Models\SsNodeLabel;
 use App\Http\Models\User;
 use App\Http\Models\UserLabel;
-use App\Mail\sendUserInfo;
 use DB;
 use Exception;
 use Hash;
 use Log;
-use Mail;
 
 trait Callback
 {
@@ -174,33 +170,6 @@ trait Callback
 					default:
 						Log::info('【处理订单】出现错误-未知套餐类型');
 				}
-				// 自动提号机:如果order的email值不为空
-				if($order->email){
-					$title = '自动发送账号信息';
-					$content = [
-						'order_sn'      => $order->order_sn,
-						'goods_name'    => $order->goods->name,
-						'goods_traffic' => flowAutoShow($order->goods->traffic*1048576),
-						'port'          => $order->user->port,
-						'passwd'        => $order->user->passwd,
-						'method'        => $order->user->method,
-						//'protocol'       => $order->user->protocol,
-						//'protocol_param' => $order->user->protocol_param,
-						//'obfs'           => $order->user->obfs,
-						//'obfs_param'     => $order->user->obfs_param,
-						'created_at'    => $order->created_at->toDateTimeString(),
-						'expire_at'     => $order->expire_at
-					];
-
-					// 获取可用节点列表
-					$labels = UserLabel::query()->where('user_id', $order->user_id)->get()->pluck('label_id');
-					$nodeIds = SsNodeLabel::query()->whereIn('label_id', $labels)->get()->pluck('node_id');
-					$nodeList = SsNode::query()->whereIn('id', $nodeIds)->orderBy('sort', 'desc')->orderBy('id', 'desc')->get()->toArray();
-					$content['serverList'] = $nodeList;
-
-					$logId = Helpers::addEmailLog($order->email, $title, json_encode($content));
-					Mail::to($order->email)->send(new sendUserInfo($logId, $content));
-				}
 			}
 
 			DB::commit();

+ 9 - 8
app/Components/Helpers.php

@@ -4,8 +4,8 @@ namespace App\Components;
 
 use App\Http\Models\Config;
 use App\Http\Models\CouponLog;
-use App\Http\Models\EmailLog;
 use App\Http\Models\Level;
+use App\Http\Models\NotificationLog;
 use App\Http\Models\SsConfig;
 use App\Http\Models\User;
 use App\Http\Models\UserSubscribe;
@@ -84,13 +84,13 @@ class Helpers
 		$user->obfs = Helpers::getDefaultObfs();
 		$user->obfs_param = '';
 		$user->usage = 1;
-		$user->transfer_enable = $transfer_enable; // 新创建的账号给1,防止定时任务执行时发现u + d >= transfer_enable被判为流量超限而封禁
+		$user->transfer_enable = $transfer_enable;
 		$user->enable_time = date('Y-m-d');
 		$user->expire_time = date('Y-m-d', strtotime("+".$data." days"));
 		$user->reg_ip = getClientIp();
 		$user->referral_uid = $referral_uid;
 		$user->reset_time = NULL;
-		$user->status = 1;
+		$user->status = 0;
 		$user->save();
 
 		return $user->id;
@@ -161,20 +161,21 @@ class Helpers
 	}
 
 	/**
-	 * 添加邮件投递日志
+	 * 添加通知推送日志
 	 *
-	 * @param string $address 收信地址
 	 * @param string $title   标题
 	 * @param string $content 内容
+	 * @param int    $type    发送类型
+	 * @param string $address 收信方
 	 * @param int    $status  投递状态
 	 * @param string $error   投递失败时记录的异常信息
 	 *
 	 * @return int
 	 */
-	public static function addEmailLog($address, $title, $content, $status = 1, $error = '')
+	public static function addNotificationLog($title, $content, $type, $address = 'admin', $status = 1, $error = '')
 	{
-		$log = new EmailLog();
-		$log->type = 1;
+		$log = new NotificationLog();
+		$log->type = $type;
 		$log->address = $address;
 		$log->title = $title;
 		$log->content = $content;

+ 3 - 3
app/Components/Namesilo.php

@@ -41,15 +41,15 @@ class Namesilo
 
 			// 出错
 			if(empty($result['namesilo']) || $result['namesilo']['reply']['code'] != 300 || $result['namesilo']['reply']['detail'] != 'success'){
-				Helpers::addEmailLog(self::$systemConfig['webmaster_email'], '[Namesilo API] - ['.$operation.']', $content, 0, $result['namesilo']['reply']['detail']);
+				Helpers::addNotificationLog('[Namesilo API] - ['.$operation.']', $content, 1, self::$systemConfig['webmaster_email'], 0, $result['namesilo']['reply']['detail']);
 			}else{
-				Helpers::addEmailLog(self::$systemConfig['webmaster_email'], '[Namesilo API] - ['.$operation.']', $content, 1, $result['namesilo']['reply']['detail']);
+				Helpers::addNotificationLog('[Namesilo API] - ['.$operation.']', $content, 1, self::$systemConfig['webmaster_email'], 1, $result['namesilo']['reply']['detail']);
 			}
 
 			return $result['namesilo']['reply'];
 		} catch(Exception $e){
 			Log::error('CURL请求失败:'.$e->getMessage().' --- '.$e->getLine());
-			Helpers::addEmailLog(self::$systemConfig['webmaster_email'], '[Namesilo API] - ['.$operation.']', $content, 0, $e->getMessage());
+			Helpers::addNotificationLog('[Namesilo API] - ['.$operation.']', $content, 1, self::$systemConfig['webmaster_email'], 0, $e->getMessage());
 
 			return FALSE;
 		}

+ 83 - 0
app/Components/PushNotification.php

@@ -0,0 +1,83 @@
+<?php
+
+
+namespace App\Components;
+
+
+use Exception;
+use Log;
+use stdClass;
+
+class PushNotification
+{
+	public static function send($title, $content)
+	{
+		switch(Helpers::systemConfig()['is_notification']){
+			case 1:
+				return self::ServerChan($title, $content);
+				break;
+			case 2:
+				return self::Bark($title, $content);
+				break;
+			default:
+		}
+	}
+
+	/**
+	 * ServerChan推送消息
+	 *
+	 * @param string $title   消息标题
+	 * @param string $content 消息内容
+	 *
+	 * @return mixed
+	 */
+	private static function ServerChan($title, $content)
+	{
+
+		try{
+			// TODO:一天仅可发送不超过500条
+			$url = 'https://sc.ftqq.com/'.Helpers::systemConfig()['server_chan_key'].'.send?text='.$title.'&desp='.urlencode($content);
+			$result = json_decode(Curl::send($url));
+			if(empty(Helpers::systemConfig()['server_chan_key'])){
+				$result = new stdClass();
+				$result->errno = TRUE;
+				$result->errmsg = "未正确配置ServerChan";
+			}
+			if($result != NULL && !$result->errno){
+				Helpers::addNotificationLog($title, $content, 2);
+			}else{
+				Helpers::addNotificationLog($title, $content, 2, 'admin', 1, $result? $result->errmsg : '未知');
+			}
+		} catch(Exception $e){
+			Log::error('ServerChan消息推送异常:'.$e);
+		}
+
+
+		return $result;
+	}
+
+	/**
+	 * Bark推送消息
+	 *
+	 * @param string $title   消息标题
+	 * @param string $content 消息内容
+	 *
+	 * @return mixed
+	 */
+	private static function Bark($title, $content)
+	{
+		try{
+			$url = 'https://api.day.app/'.Helpers::systemConfig()['bark_key'].'/'.$title.'/'.$content;
+			$result = json_decode(Curl::send($url));
+			if($result->code == 200){
+				Helpers::addNotificationLog($title, $content, 3);
+			}else{
+				Helpers::addNotificationLog($title, $content, 3, 'admin', $result->message);
+			}
+		} catch(Exception $e){
+			Log::error('Bark消息推送异常:'.$e);
+		}
+
+		return $result;
+	}
+}

+ 0 - 64
app/Components/ServerChan.php

@@ -1,64 +0,0 @@
-<?php
-
-namespace App\Components;
-
-use App\Http\Models\EmailLog;
-use Exception;
-use Log;
-
-class ServerChan
-{
-	/**
-	 * 推送消息
-	 *
-	 * @param string $title   消息标题
-	 * @param string $content 消息内容
-	 *
-	 * @return mixed
-	 */
-	public static function send($title, $content)
-	{
-		if(Helpers::systemConfig()['is_server_chan'] && Helpers::systemConfig()['server_chan_key']){
-			try{
-				// TODO:一天仅可发送不超过500条
-				$url = 'https://sc.ftqq.com/'.Helpers::systemConfig()['server_chan_key'].'.send?text='.$title.'&desp='.urlencode($content);
-				$response = Curl::send($url);
-				$result = json_decode($response);
-				if(!$result->errno){
-					self::addLog($title, $content);
-				}else{
-					self::addLog($title, $content, 0, $result->errmsg);
-				}
-			} catch(Exception $e){
-				Log::error('ServerChan消息推送异常:'.$e);
-			}
-		}else{
-			Log::error('消息推送失败:未启用或未正确配置ServerChan');
-		}
-
-		return;
-	}
-
-	/**
-	 * 添加serverChan推送日志
-	 *
-	 * @param string $title   标题
-	 * @param string $content 内容
-	 * @param int    $status  投递状态
-	 * @param string $error   投递失败时记录的异常信息
-	 *
-	 * @return int
-	 */
-	private static function addLog($title, $content, $status = 1, $error = '')
-	{
-		$log = new EmailLog();
-		$log->type = 2;
-		$log->address = 'admin';
-		$log->title = $title;
-		$log->content = $content;
-		$log->status = $status;
-		$log->error = $error;
-
-		return $log->save();
-	}
-}

+ 19 - 3
app/Console/Commands/AutoJob.php

@@ -3,7 +3,7 @@
 namespace App\Console\Commands;
 
 use App\Components\Helpers;
-use App\Components\ServerChan;
+use App\Components\PushNotification;
 use App\Http\Models\Config;
 use App\Http\Models\Coupon;
 use App\Http\Models\Invite;
@@ -17,6 +17,7 @@ use App\Http\Models\UserSubscribe;
 use App\Http\Models\UserSubscribeLog;
 use App\Http\Models\UserTrafficHourly;
 use App\Http\Models\VerifyCode;
+use Cache;
 use DB;
 use Exception;
 use Illuminate\Console\Command;
@@ -238,13 +239,28 @@ class AutoJob extends Command
 	// 检测节点是否离线
 	private function checkNodeStatus()
 	{
-		if(Helpers::systemConfig()['is_node_crash_warning']){
+		if(Helpers::systemConfig()['is_node_offline']){
 			$nodeList = SsNode::query()->where('is_transit', 0)->where('status', 1)->get();
 			foreach($nodeList as $node){
 				// 10分钟内无节点负载信息则认为是后端炸了
 				$nodeTTL = SsNodeInfo::query()->where('node_id', $node->id)->where('log_time', '>=', strtotime("-10 minutes"))->orderBy('id', 'desc')->doesntExist();
 				if($nodeTTL){
-					ServerChan::send('节点异常警告', "节点**{$node->name}【{$node->ip}】**异常:**心跳异常,可能离线了**");
+					if(self::$systemConfig['offline_check_times']){
+						// 已通知次数
+						$cacheKey = 'offline_check_times'.$node->id;
+						if(Cache::has($cacheKey)){
+							$times = Cache::get($cacheKey);
+						}else{
+							// 键将保留24小时
+							Cache::put($cacheKey, 1, 86400);
+							$times = 1;
+						}
+
+						if($times < self::$systemConfig['offline_check_times']){
+							Cache::increment($cacheKey);
+							PushNotification::send('节点异常警告', "节点**{$node->name}【{$node->ip}】**异常:**心跳异常,可能离线了**");
+						}
+					}
 				}
 			}
 		}

+ 2 - 2
app/Console/Commands/AutoReportNode.php

@@ -3,7 +3,7 @@
 namespace App\Console\Commands;
 
 use App\Components\Helpers;
-use App\Components\ServerChan;
+use App\Components\PushNotification;
 use App\Http\Models\SsNode;
 use App\Http\Models\SsNodeTrafficDaily;
 use Illuminate\Console\Command;
@@ -43,7 +43,7 @@ class AutoReportNode extends Command
 					}
 				}
 
-				ServerChan::send('节点日报', $msg);
+				PushNotification::send('节点日报', $msg);
 			}
 		}
 

+ 3 - 3
app/Console/Commands/DailyJob.php

@@ -3,7 +3,7 @@
 namespace App\Console\Commands;
 
 use App\Components\Helpers;
-use App\Components\ServerChan;
+use App\Components\PushNotification;
 use App\Http\Models\Invite;
 use App\Http\Models\Order;
 use App\Http\Models\Ticket;
@@ -113,7 +113,7 @@ class DailyJob extends Command
 		foreach($ticketList as $ticket){
 			$ret = Ticket::query()->where('id', $ticket->id)->update(['status' => 2]);
 			if($ret){
-				ServerChan::send('工单关闭提醒', '工单:ID'.$ticket->id.'超过72小时未处理,系统已自动关闭');
+				PushNotification::send('工单关闭提醒', '工单:ID'.$ticket->id.'超过72小时未处理,系统已自动关闭');
 			}
 		}
 	}
@@ -165,7 +165,7 @@ class DailyJob extends Command
 			}
 			// 重置流量
 			User::query()->where('id', $user->id)->update(['u' => 0, 'd' => 0, 'transfer_enable' => $order->goods->traffic*1048576, 'reset_time' => $nextResetTime]);
-			Log::info('用户[ID:'.$user->id.'  昵称: '.$user->username.'  邮箱: '.$user->email.'] 流量重置为 '.($order->goods->traffic*1048576).'. 重置日期为 '.($nextResetTime? : '【无】'));
+			//Log::info('用户[ID:'.$user->id.'  昵称: '.$user->username.'  邮箱: '.$user->email.'] 流量重置为 '.($order->goods->traffic*1048576).'. 重置日期为 '.($nextResetTime? : '【无】'));
 		}
 	}
 }

+ 8 - 8
app/Console/Commands/NodeBlockedDetection.php

@@ -4,7 +4,7 @@ namespace App\Console\Commands;
 
 use App\Components\Helpers;
 use App\Components\NetworkDetection;
-use App\Components\ServerChan;
+use App\Components\PushNotification;
 use App\Http\Models\SsNode;
 use App\Mail\nodeCrashWarning;
 use Cache;
@@ -84,18 +84,18 @@ class NodeBlockedDetection extends Command
 
 			// 节点检测次数
 			if($info){
-				if(self::$systemConfig['numberOfWarningTimes']){
+				if(self::$systemConfig['detection_check_times']){
 					// 已通知次数
-					$cacheKey = 'numberOfWarningTimes'.$node->id;
+					$cacheKey = 'detection_check_times'.$node->id;
 					if(Cache::has($cacheKey)){
 						$times = Cache::get($cacheKey);
 					}else{
 						// 键将保留12小时,多10分钟防意外
-						Cache::put($cacheKey, 1, 83800);
+						Cache::put($cacheKey, 1, 43800);
 						$times = 1;
 					}
 
-					if($times < self::$systemConfig['numberOfWarningTimes']){
+					if($times < self::$systemConfig['detection_check_times']){
 						Cache::increment($cacheKey);
 					}else{
 						Cache::forget($cacheKey);
@@ -113,7 +113,7 @@ class NodeBlockedDetection extends Command
 		}
 
 		// 随机生成下次检测时间
-		Cache::put('LastCheckTime', time()+mt_rand(3000, 3600), 3600);
+		Cache::put('LastCheckTime', time()+mt_rand(3000, 3600), 4000);
 	}
 
 	/**
@@ -126,9 +126,9 @@ class NodeBlockedDetection extends Command
 	private function notifyMaster($title, $content)
 	{
 		if(self::$systemConfig['webmaster_email']){
-			$logId = Helpers::addEmailLog(self::$systemConfig['webmaster_email'], $title, $content);
+			$logId = Helpers::addNotificationLog($title, $content, 1, self::$systemConfig['webmaster_email']);
 			Mail::to(self::$systemConfig['webmaster_email'])->send(new nodeCrashWarning($logId));
 		}
-		ServerChan::send($title, $content);
+		PushNotification::send($title, $content);
 	}
 }

+ 2 - 2
app/Console/Commands/UserExpireAutoWarning.php

@@ -53,13 +53,13 @@ class UserExpireAutoWarning extends Command
 				$title = '账号过期提醒';
 				$content = '您的账号将于今天晚上【24:00】过期。';
 
-				$logId = Helpers::addEmailLog($user->email, $title, $content);
+				$logId = Helpers::addNotificationLog($title, $content, 1, $user->email);
 				Mail::to($user->email)->send(new userExpireWarningToday($logId));
 			}elseif($lastCanUseDays > 0 && $lastCanUseDays <= self::$systemConfig['expire_days']){
 				$title = '账号过期提醒';
 				$content = '您的账号还剩'.$lastCanUseDays.'天即将过期。';
 
-				$logId = Helpers::addEmailLog($user->email, $title, $content);
+				$logId = Helpers::addNotificationLog($title, $content, 1, $user->email);
 				Mail::to($user->email)->send(new userExpireWarning($logId, $lastCanUseDays));
 			}
 		}

+ 3 - 3
app/Console/Commands/UserTrafficAbnormalAutoWarning.php

@@ -3,7 +3,7 @@
 namespace App\Console\Commands;
 
 use App\Components\Helpers;
-use App\Components\ServerChan;
+use App\Components\PushNotification;
 use App\Http\Models\User;
 use App\Http\Models\UserTrafficHourly;
 use Illuminate\Console\Command;
@@ -45,13 +45,13 @@ class UserTrafficAbnormalAutoWarning extends Command
 			foreach($userTotalTrafficList as $vo){
 				$user = User::query()->where('id', $vo->user_id)->first();
 
-				// 通过ServerChan发微信消息提醒管理员
+				// 推送通知管理员
 				if($vo->totalTraffic > (self::$systemConfig['traffic_ban_value']*1073741824)){
 					$traffic = UserTrafficHourly::query()->where('node_id', 0)->where('user_id', $vo->user_id)->where('created_at', '>=', date('Y-m-d H:i:s', time()-3900))->selectRaw("user_id, sum(`u`) as totalU, sum(`d`) as totalD, sum(total) as totalTraffic")->first();
 
 					$content = "用户**{$user->email}(ID:{$user->id})**,最近1小时**上行流量:".flowAutoShow($traffic->totalU).",下行流量:".flowAutoShow($traffic->totalD).",共计:".flowAutoShow($traffic->totalTraffic)."**。";
 
-					ServerChan::send($title, $content);
+					PushNotification::send($title, $content);
 				}
 			}
 		}

+ 1 - 1
app/Console/Commands/UserTrafficAutoWarning.php

@@ -51,7 +51,7 @@ class UserTrafficAutoWarning extends Command
 				$title = '流量提醒';
 				$content = '流量已使用:'.$usedPercent.'%,请保持关注。';
 
-				$logId = Helpers::addEmailLog($user->email, $title, $content);
+				$logId = Helpers::addNotificationLog($title, $content, 1, $user->email);
 				Mail::to($user->email)->send(new userTrafficWarning($logId, $usedPercent));
 			}
 		}

+ 38 - 26
app/Http/Controllers/AdminController.php

@@ -5,14 +5,15 @@ namespace App\Http\Controllers;
 use App\Components\Helpers;
 use App\Components\IPIP;
 use App\Components\NetworkDetection;
+use App\Components\PushNotification;
 use App\Components\QQWry;
 use App\Http\Models\Article;
 use App\Http\Models\Config;
 use App\Http\Models\Country;
-use App\Http\Models\EmailLog;
 use App\Http\Models\Invite;
 use App\Http\Models\Label;
 use App\Http\Models\Level;
+use App\Http\Models\NotificationLog;
 use App\Http\Models\Order;
 use App\Http\Models\ReferralApply;
 use App\Http\Models\ReferralLog;
@@ -1968,24 +1969,24 @@ EOF;
 		$value = trim($request->input('value'));
 
 		if(!$name){
-			return Response::json(['status' => 'fail', 'data' => '', 'message' => '设置失败:请求参数异常']);
+			return Response::json(['status' => 'fail', 'message' => '设置失败:请求参数异常']);
 		}
 
 		// 屏蔽异常配置
 		if(!array_key_exists($name, self::$systemConfig)){
-			return Response::json(['status' => 'fail', 'data' => '', 'message' => '设置失败:配置不存在']);
+			return Response::json(['status' => 'fail', 'message' => '设置失败:配置不存在']);
 		}
 
 		// 如果开启用户邮件重置密码,则先设置网站名称和网址
-		if(in_array($name, ['is_reset_password', 'is_active_register']) && $value == '1'){
+		if(in_array($name, ['is_reset_password', 'is_activate_account', 'expire_warning','traffic_warning']) && $value != '0'){
 			$config = Config::query()->where('name', 'website_name')->first();
 			if($config->value == ''){
-				return Response::json(['status' => 'fail', 'data' => '', 'message' => '设置失败:启用该配置需要先设置【网站名称】']);
+				return Response::json(['status' => 'fail', 'message' => '设置失败:启用该配置需要先设置【网站名称】']);
 			}
 
 			$config = Config::query()->where('name', 'website_url')->first();
 			if($config->value == ''){
-				return Response::json(['status' => 'fail', 'data' => '', 'message' => '设置失败:启用该配置需要先设置【网站地址】']);
+				return Response::json(['status' => 'fail', 'message' => '设置失败:启用该配置需要先设置【网站地址】']);
 			}
 		}
 
@@ -1994,7 +1995,7 @@ EOF;
 			$denyConfig = ['website_url', 'min_rand_traffic', 'max_rand_traffic', 'push_bear_send_key', 'push_bear_qrcode', 'is_forbid_china', 'alipay_partner', 'alipay_key', 'alipay_transport', 'alipay_sign_type', 'alipay_private_key', 'alipay_public_key', 'website_security_code'];
 
 			if(in_array($name, $denyConfig)){
-				return Response::json(['status' => 'fail', 'data' => '', 'message' => '演示环境禁止修改该配置']);
+				return Response::json(['status' => 'fail', 'message' => '演示环境禁止修改该配置']);
 			}
 		}
 
@@ -2003,28 +2004,39 @@ EOF;
 			$value = intval($value)/100;
 		}
 
-		// 用支付国际则不可用支付宝当面付
-		if(in_array($name, ['is_alipay'])){
-			$is_f2fpay = Config::query()->where('name', 'is_f2fpay')->first();
-			if($is_f2fpay->value){
-				return Response::json(['status' => 'fail', 'data' => '', 'message' => '已经在使用【支付宝当面付】']);
-			}
-		}
-
-		// 用支付宝当面则不可用支付宝国际
-		if(in_array($name, ['is_f2fpay'])){
-			$is_alipay = Config::query()->where('name', 'is_alipay')->first();
-			if($is_alipay->value){
-				return Response::json(['status' => 'fail', 'data' => '', 'message' => '已经在使用【支付宝国际支付】']);
-			}
-		}
-
 		// 更新配置
 		Config::query()->where('name', $name)->update(['value' => $value]);
 
 		return Response::json(['status' => 'success', 'data' => '', 'message' => '操作成功']);
 	}
 
+	//推送通知测试
+	public function sendTestNotification()
+	{
+		if(Helpers::systemConfig()['is_notification']){
+			$result = PushNotification::send('这是测试的标题', 'SSRPanel_OM测试内容');
+			switch(Helpers::systemConfig()['is_notification']){
+				case 1:
+					if(!$result->errno){
+						return Response::json(['status' => 'success', 'message' => '发送成功,请查看手机是否收到推送消息']);
+					}else{
+						return Response::json(['status' => 'fail', 'message' => $result? $result->errmsg : '未知']);
+					}
+					break;
+				case 2:
+					if($result->code == 200){
+						return Response::json(['status' => 'success', 'message' => '发送成功,请查看手机是否收到推送消息']);
+					}else{
+						return Response::json(['status' => 'fail', 'message' => $result->message]);
+					}
+					break;
+				default:
+			}
+		}
+
+		return Response::json(['status' => 'fail', 'message' => '请先选择【日志通知】渠道']);
+	}
+
 	// 邀请码列表
 	public function inviteList(Request $request)
 	{
@@ -2466,12 +2478,12 @@ EOF;
 	}
 
 	// 邮件发送日志列表
-	public function emailLog(Request $request)
+	public function notificationLog(Request $request)
 	{
 		$email = $request->input('email');
 		$type = $request->input('type');
 
-		$query = EmailLog::query();
+		$query = NotificationLog::query();
 
 		if(isset($email)){
 			$query->where('address', 'like', '%'.$email.'%');
@@ -2483,7 +2495,7 @@ EOF;
 
 		$view['list'] = $query->orderBy('id', 'desc')->paginate(15)->appends($request->except('page'));
 
-		return Response::view('admin.emailLog', $view);
+		return Response::view('admin.notificationLog', $view);
 	}
 
 	// 在线IP监控(实时)

+ 53 - 41
app/Http/Controllers/AuthController.php

@@ -104,7 +104,7 @@ class AuthController extends Controller
 					Auth::logout(); // 强制销毁会话,因为Auth::attempt的时候会产生会话
 
 					return Redirect::back()->withInput()->withErrors(trans('auth.login_ban', ['email' => self::$systemConfig['webmaster_email']]));
-				}elseif(Auth::user()->status == 0 && (self::$systemConfig['is_active_register'] || self::$systemConfig['is_verify_register'])){
+				}elseif(Auth::user()->status == 0 && self::$systemConfig['is_activate_account']){
 					Auth::logout(); // 强制销毁会话,因为Auth::attempt的时候会产生会话
 
 					return Redirect::back()->withInput()->withErrors(trans('auth.active_tip').'<a href="/activeUser?email='.$email.'" target="_blank"><span style="color:#000">【'.trans('auth.active_account').'】</span></a>');
@@ -238,18 +238,10 @@ class AuthController extends Controller
 			}
 
 			// 校验域名邮箱黑白名单
-			if(self::$systemConfig['sensitiveType']){
-				// 校验域名邮箱是否在黑名单中
-				$sensitiveWords = $this->sensitiveWords(1);
-				$emailSuffix = explode('@', $email); // 提取邮箱后缀
-				if(in_array(strtolower($emailSuffix[1]), $sensitiveWords)){
-					return Redirect::back()->withInput()->withErrors(trans('auth.email_banned'));
-				}
-			}else{
-				$sensitiveWords = $this->sensitiveWords(2);
-				$emailSuffix = explode('@', $email); // 提取邮箱后缀
-				if(!in_array(strtolower($emailSuffix[1]), $sensitiveWords)){
-					return Redirect::back()->withInput()->withErrors(trans('auth.email_invalid'));
+			if(self::$systemConfig['is_email_filtering']){
+				$result = $this->emailChecker($email);
+				if($result != FALSE){
+					return $result;
 				}
 			}
 
@@ -269,8 +261,8 @@ class AuthController extends Controller
 				}
 			}
 
-			// 如果开启注册发送验证
-			if(self::$systemConfig['is_verify_register']){
+			// 注册前发送激活
+			if(self::$systemConfig['is_activate_account'] == 1){
 				if(!$verify_code){
 					return Redirect::back()->withInput($request->except(['verify_code']))->withErrors(trans('auth.captcha_null'));
 				}else{
@@ -380,13 +372,13 @@ class AuthController extends Controller
 			// 清除邀请人Cookie
 			Cookie::unqueue('register_aff');
 
-			// 邮箱验证码关闭情况下,发送激活邮件
-			if(!self::$systemConfig['is_verify_register'] && self::$systemConfig['is_active_register']){
+			// 注册后发送激活码
+			if(self::$systemConfig['is_activate_account'] == 2){
 				// 生成激活账号的地址
 				$token = $this->addVerifyUrl($uid, $email);
 				$activeUserUrl = self::$systemConfig['website_url'].'/active/'.$token;
 
-				$logId = Helpers::addEmailLog($email, '注册激活', '请求地址:'.$activeUserUrl);
+				$logId = Helpers::addNotificationLog('注册激活', '请求地址:'.$activeUserUrl, 1, $email);
 				Mail::to($email)->send(new activeUser($logId, $activeUserUrl));
 
 				Session::flash('regSuccessMsg', trans('auth.register_active_tip'));
@@ -400,20 +392,48 @@ class AuthController extends Controller
 						}
 					}
 				}
-				User::query()->where('id', $uid)->update(['status' => 1, 'enable' => 1]);
+
+				if(self::$systemConfig['is_activate_account'] == 1){
+					User::query()->where('id', $uid)->update(['status' => 1]);
+				}
 
 				Session::flash('regSuccessMsg', trans('auth.register_success'));
 			}
 
 			return Redirect::to('login')->withInput();
 		}else{
-			$view['emailList'] = self::$systemConfig['sensitiveType']? NULL : SensitiveWords::query()->where('type', 2)->get();
+			$view['emailList'] = self::$systemConfig['is_email_filtering'] != 2? FALSE : SensitiveWords::query()->where('type', 2)->get();
 			Session::put('register_token', makeRandStr(16));
 
 			return Response::view('auth.register', $view);
 		}
 	}
 
+	//邮箱检查
+	private function emailChecker($email)
+	{
+		$sensitiveWords = $this->sensitiveWords(self::$systemConfig['is_email_filtering']);
+		$emailSuffix = explode('@', $email); // 提取邮箱后缀
+		switch(self::$systemConfig['is_email_filtering']){
+			// 黑名单
+			case 1:
+				if(in_array(strtolower($emailSuffix[1]), $sensitiveWords)){
+					return Response::json(['status' => 'fail', 'message' => trans('auth.email_banned')]);
+				}
+				break;
+			//白名单
+			case 2:
+				if(!in_array(strtolower($emailSuffix[1]), $sensitiveWords)){
+					return Response::json(['status' => 'fail', 'message' => trans('auth.email_invalid')]);
+				}
+				break;
+			default:
+				return Response::json(['status' => 'fail', 'message' => trans('auth.email_invalid')]);
+		}
+
+		return FALSE;
+	}
+
 	/**
 	 * 获取AFF
 	 *
@@ -512,7 +532,7 @@ class AuthController extends Controller
 			// 发送邮件
 			$resetPasswordUrl = self::$systemConfig['website_url'].'/reset/'.$token;
 
-			$logId = Helpers::addEmailLog($email, '重置密码', '请求地址:'.$resetPasswordUrl);
+			$logId = Helpers::addNotificationLog('重置密码', '请求地址:'.$resetPasswordUrl, 1, $email);
 			Mail::to($email)->send(new resetPassword($logId, $resetPasswordUrl));
 
 			Cache::put('resetPassword_'.md5($email), $resetTimes+1, 86400);
@@ -596,7 +616,7 @@ class AuthController extends Controller
 			$email = $request->input('email');
 
 			// 是否开启账号激活
-			if(!self::$systemConfig['is_active_register']){
+			if(self::$systemConfig['is_activate_account'] != 2){
 				return Redirect::back()->withInput()->withErrors(trans('auth.active_close', ['email' => self::$systemConfig['webmaster_email']]));
 			}
 
@@ -623,7 +643,7 @@ class AuthController extends Controller
 			// 发送邮件
 			$activeUserUrl = self::$systemConfig['website_url'].'/active/'.$token;
 
-			$logId = Helpers::addEmailLog($email, '激活账号', '请求地址:'.$activeUserUrl);
+			$logId = Helpers::addNotificationLog('激活账号', '请求地址:'.$activeUserUrl, 1, $email);
 			Mail::to($email)->send(new activeUser($logId, $activeUserUrl));
 
 			Cache::put('activeUser_'.md5($email), $activeTimes+1, 86400);
@@ -704,45 +724,37 @@ class AuthController extends Controller
 		$email = $request->input('email');
 
 		if($validator->fails()){
-			return Response::json(['status' => 'fail', 'data' => '', 'message' => $validator->getMessageBag()->first()]);
+			return Response::json(['status' => 'fail', 'message' => $validator->getMessageBag()->first()]);
 		}
 
 		// 校验域名邮箱黑白名单
-		if(self::$systemConfig['sensitiveType']){
-			// 校验域名邮箱是否在黑名单中
-			$sensitiveWords = $this->sensitiveWords(1);
-			$emailSuffix = explode('@', $email); // 提取邮箱后缀
-			if(in_array(strtolower($emailSuffix[1]), $sensitiveWords)){
-				return Response::json(['status' => 'fail', 'data' => '', 'message' => trans('auth.email_banned')]);
-			}
-		}else{
-			$sensitiveWords = $this->sensitiveWords(2);
-			$emailSuffix = explode('@', $email); // 提取邮箱后缀
-			if(!in_array(strtolower($emailSuffix[1]), $sensitiveWords)){
-				return Response::json(['status' => 'fail', 'data' => '', 'message' => trans('auth.email_invalid')]);
+		if(self::$systemConfig['is_email_filtering']){
+			$result = $this->emailChecker($email);
+			if($result != FALSE){
+				return $result;
 			}
 		}
 
 		// 是否开启注册发送验证码
-		if(!self::$systemConfig['is_verify_register']){
-			return Response::json(['status' => 'fail', 'data' => '', 'message' => trans('auth.captcha_close')]);
+		if(self::$systemConfig['is_activate_account'] != 1){
+			return Response::json(['status' => 'fail', 'message' => trans('auth.captcha_close')]);
 		}
 
 		// 防刷机制
 		if(Cache::has('send_verify_code_'.md5(getClientIP()))){
-			return Response::json(['status' => 'fail', 'data' => '', 'message' => trans('auth.register_anti')]);
+			return Response::json(['status' => 'fail', 'message' => trans('auth.register_anti')]);
 		}
 
 		// 发送邮件
 		$code = makeRandStr(6, TRUE);
-		$logId = Helpers::addEmailLog($email, '发送注册验证码', '验证码:'.$code);
+		$logId = Helpers::addNotificationLog('发送注册验证码', '验证码:'.$code, 1, $email);
 		Mail::to($email)->send(new sendVerifyCode($logId, $code));
 
 		$this->addVerifyCode($email, $code);
 
 		Cache::put('send_verify_code_'.md5(getClientIP()), getClientIP(), 60);
 
-		return Response::json(['status' => 'success', 'data' => '', 'message' => trans('auth.captcha_send')]);
+		return Response::json(['status' => 'success', 'message' => trans('auth.captcha_send')]);
 	}
 
 	// 生成注册验证码

+ 6 - 6
app/Http/Controllers/TicketController.php

@@ -3,7 +3,7 @@
 namespace App\Http\Controllers;
 
 use App\Components\Helpers;
-use App\Components\ServerChan;
+use App\Components\PushNotification;
 use App\Http\Models\Ticket;
 use App\Http\Models\TicketReply;
 use App\Mail\closeTicket;
@@ -76,17 +76,17 @@ class TicketController extends Controller
 				// 发通知邮件
 				if(!Auth::user()->is_admin){
 					if(self::$systemConfig['webmaster_email']){
-						$logId = Helpers::addEmailLog(self::$systemConfig['webmaster_email'], $title, $content);
+						$logId = Helpers::addNotificationLog($title, $content, 1, self::$systemConfig['webmaster_email']);
 						Mail::to(self::$systemConfig['webmaster_email'])->send(new replyTicket($logId, $title, $content));
 					}
 				}else{
-					$logId = Helpers::addEmailLog($ticket->user->email, $title, $content);
+					$logId = Helpers::addNotificationLog($title, $content, 1, $ticket->user->email);
 					Mail::to($ticket->user->email)->send(new replyTicket($logId, $title, $content));
 				}
 
-				// 通过ServerChan发微信消息提醒管理员
+				// 推送通知管理员
 				if(!Auth::user()->is_admin){
-					ServerChan::send($title, $content);
+					PushNotification::send($title, $content);
 				}
 
 				return Response::json(['status' => 'success', 'data' => '', 'message' => '回复成功']);
@@ -121,7 +121,7 @@ class TicketController extends Controller
 		$content = "工单【".$ticket->title."】已关闭";
 
 		// 发邮件通知用户
-		$logId = Helpers::addEmailLog($ticket->user->email, $title, $content);
+		$logId = Helpers::addNotificationLog($title, $content, 1, $ticket->user->email);
 		Mail::to($ticket->user->email)->send(new closeTicket($logId, $title, $content));
 
 		return Response::json(['status' => 'success', 'data' => '', 'message' => '关闭成功']);

+ 6 - 6
app/Http/Controllers/UserController.php

@@ -4,7 +4,7 @@ namespace App\Http\Controllers;
 
 use App\Components\Callback;
 use App\Components\Helpers;
-use App\Components\ServerChan;
+use App\Components\PushNotification;
 use App\Http\Models\Article;
 use App\Http\Models\Coupon;
 use App\Http\Models\Goods;
@@ -352,11 +352,11 @@ class UserController extends Controller
 
 			// 发邮件通知管理员
 			if(self::$systemConfig['webmaster_email']){
-				$logId = Helpers::addEmailLog(self::$systemConfig['webmaster_email'], $emailTitle, $content);
+				$logId = Helpers::addNotificationLog($emailTitle, $content, 1, self::$systemConfig['webmaster_email']);
 				Mail::to(self::$systemConfig['webmaster_email'])->send(new newTicket($logId, $emailTitle, $content));
 			}
 
-			ServerChan::send($emailTitle, $content);
+			PushNotification::send($emailTitle, $content);
 
 			return Response::json(['status' => 'success', 'data' => '', 'message' => '提交成功']);
 		}else{
@@ -400,11 +400,11 @@ class UserController extends Controller
 
 				// 发邮件通知管理员
 				if(self::$systemConfig['webmaster_email']){
-					$logId = Helpers::addEmailLog(self::$systemConfig['webmaster_email'], $title, $content);
+					$logId = Helpers::addNotificationLog($title, $content, 1, self::$systemConfig['webmaster_email']);
 					Mail::to(self::$systemConfig['webmaster_email'])->send(new replyTicket($logId, $title, $content));
 				}
 
-				ServerChan::send($title, $content);
+				PushNotification::send($title, $content);
 
 				return Response::json(['status' => 'success', 'data' => '', 'message' => '回复成功']);
 			}else{
@@ -425,7 +425,7 @@ class UserController extends Controller
 
 		$ret = Ticket::uid()->where('id', $id)->update(['status' => 2]);
 		if($ret){
-			ServerChan::send('工单关闭提醒', '工单:ID'.$id.'用户已手动关闭');
+			PushNotification::send('工单关闭提醒', '工单:ID'.$id.'用户已手动关闭');
 
 			return Response::json(['status' => 'success', 'data' => '', 'message' => '关闭成功']);
 		}else{

+ 0 - 43
app/Http/Models/EmailLog.php

@@ -1,43 +0,0 @@
-<?php
-
-namespace App\Http\Models;
-
-use Eloquent;
-use Illuminate\Database\Eloquent\Builder;
-use Illuminate\Database\Eloquent\Model;
-use Illuminate\Support\Carbon;
-
-/**
- * 邮件/ServerChan发送日志
- * Class EmailLog
- *
- * @package App\Http\Models
- * @mixin Eloquent
- * @property int         $id
- * @property int         $type       类型:1-邮件、2-serverChan
- * @property string      $address    收信地址
- * @property string      $title      标题
- * @property string      $content    内容
- * @property int         $status     状态:-1发送失败、0-等待发送、1-发送成功
- * @property string|null $error      发送失败抛出的异常信息
- * @property Carbon|null $created_at 创建时间
- * @property Carbon|null $updated_at 最后更新时间
- * @method static Builder|EmailLog newModelQuery()
- * @method static Builder|EmailLog newQuery()
- * @method static Builder|EmailLog query()
- * @method static Builder|EmailLog whereAddress($value)
- * @method static Builder|EmailLog whereContent($value)
- * @method static Builder|EmailLog whereCreatedAt($value)
- * @method static Builder|EmailLog whereError($value)
- * @method static Builder|EmailLog whereId($value)
- * @method static Builder|EmailLog whereStatus($value)
- * @method static Builder|EmailLog whereTitle($value)
- * @method static Builder|EmailLog whereType($value)
- * @method static Builder|EmailLog whereUpdatedAt($value)
- */
-class EmailLog extends Model
-{
-	protected $table = 'email_log';
-	protected $primaryKey = 'id';
-
-}

+ 43 - 0
app/Http/Models/NotificationLog.php

@@ -0,0 +1,43 @@
+<?php
+
+namespace App\Http\Models;
+
+use Eloquent;
+use Illuminate\Database\Eloquent\Builder;
+use Illuminate\Database\Eloquent\Model;
+use Illuminate\Support\Carbon;
+
+/**
+ * 推送通知日志
+ * Class NotificationLog
+ *
+ * @package App\Http\Models
+ * @mixin Eloquent
+ * @property int         $id
+ * @property int         $type       类型:1-邮件、2-ServerChan、3-Bark
+ * @property string      $address    收信地址
+ * @property string      $title      标题
+ * @property string      $content    内容
+ * @property int         $status     状态:-1发送失败、0-等待发送、1-发送成功
+ * @property string|null $error      发送失败抛出的异常信息
+ * @property Carbon|null $created_at 创建时间
+ * @property Carbon|null $updated_at 最后更新时间
+ * @method static Builder|NotificationLog newModelQuery()
+ * @method static Builder|NotificationLog newQuery()
+ * @method static Builder|NotificationLog query()
+ * @method static Builder|NotificationLog whereAddress($value)
+ * @method static Builder|NotificationLog whereContent($value)
+ * @method static Builder|NotificationLog whereCreatedAt($value)
+ * @method static Builder|NotificationLog whereError($value)
+ * @method static Builder|NotificationLog whereId($value)
+ * @method static Builder|NotificationLog whereStatus($value)
+ * @method static Builder|NotificationLog whereTitle($value)
+ * @method static Builder|NotificationLog whereType($value)
+ * @method static Builder|NotificationLog whereUpdatedAt($value)
+ */
+class NotificationLog extends Model
+{
+	protected $table = 'notification_log';
+	protected $primaryKey = 'id';
+
+}

+ 2 - 2
app/Mail/activeUser.php

@@ -2,7 +2,7 @@
 
 namespace App\Mail;
 
-use App\Http\Models\EmailLog;
+use App\Http\Models\NotificationLog;
 use Exception;
 use Illuminate\Bus\Queueable;
 use Illuminate\Contracts\Queue\ShouldQueue;
@@ -32,6 +32,6 @@ class activeUser extends Mailable implements ShouldQueue
 	// 发件失败处理
 	public function failed(Exception $e)
 	{
-		EmailLog::query()->where('id', $this->id)->update(['status' => -1, 'error' => $e->getMessage()]);
+		NotificationLog::query()->where('id', $this->id)->update(['status' => -1, 'error' => $e->getMessage()]);
 	}
 }

+ 2 - 2
app/Mail/closeTicket.php

@@ -2,7 +2,7 @@
 
 namespace App\Mail;
 
-use App\Http\Models\EmailLog;
+use App\Http\Models\NotificationLog;
 use Exception;
 use Illuminate\Bus\Queueable;
 use Illuminate\Contracts\Queue\ShouldQueue;
@@ -35,6 +35,6 @@ class closeTicket extends Mailable implements ShouldQueue
 	// 发件失败处理
 	public function failed(Exception $e)
 	{
-		EmailLog::query()->where('id', $this->id)->update(['status' => -1, 'error' => $e->getMessage()]);
+		NotificationLog::query()->where('id', $this->id)->update(['status' => -1, 'error' => $e->getMessage()]);
 	}
 }

+ 2 - 2
app/Mail/newTicket.php

@@ -2,7 +2,7 @@
 
 namespace App\Mail;
 
-use App\Http\Models\EmailLog;
+use App\Http\Models\NotificationLog;
 use Exception;
 use Illuminate\Bus\Queueable;
 use Illuminate\Contracts\Queue\ShouldQueue;
@@ -35,6 +35,6 @@ class newTicket extends Mailable implements ShouldQueue
 	// 发件失败处理
 	public function failed(Exception $e)
 	{
-		EmailLog::query()->where('id', $this->id)->update(['status' => -1, 'error' => $e->getMessage()]);
+		NotificationLog::query()->where('id', $this->id)->update(['status' => -1, 'error' => $e->getMessage()]);
 	}
 }

+ 2 - 2
app/Mail/nodeCrashWarning.php

@@ -2,7 +2,7 @@
 
 namespace App\Mail;
 
-use App\Http\Models\EmailLog;
+use App\Http\Models\NotificationLog;
 use Exception;
 use Illuminate\Bus\Queueable;
 use Illuminate\Contracts\Queue\ShouldQueue;
@@ -28,6 +28,6 @@ class nodeCrashWarning extends Mailable implements ShouldQueue
 	// 发件失败处理
 	public function failed(Exception $e)
 	{
-		EmailLog::query()->where('id', $this->id)->update(['status' => -1, 'error' => $e->getMessage()]);
+		NotificationLog::query()->where('id', $this->id)->update(['status' => -1, 'error' => $e->getMessage()]);
 	}
 }

+ 2 - 2
app/Mail/replyTicket.php

@@ -2,7 +2,7 @@
 
 namespace App\Mail;
 
-use App\Http\Models\EmailLog;
+use App\Http\Models\NotificationLog;
 use Exception;
 use Illuminate\Bus\Queueable;
 use Illuminate\Contracts\Queue\ShouldQueue;
@@ -35,6 +35,6 @@ class replyTicket extends Mailable implements ShouldQueue
 	// 发件失败处理
 	public function failed(Exception $e)
 	{
-		EmailLog::query()->where('id', $this->id)->update(['status' => -1, 'error' => $e->getMessage()]);
+		NotificationLog::query()->where('id', $this->id)->update(['status' => -1, 'error' => $e->getMessage()]);
 	}
 }

+ 2 - 2
app/Mail/resetPassword.php

@@ -2,7 +2,7 @@
 
 namespace App\Mail;
 
-use App\Http\Models\EmailLog;
+use App\Http\Models\NotificationLog;
 use Exception;
 use Illuminate\Bus\Queueable;
 use Illuminate\Contracts\Queue\ShouldQueue;
@@ -32,6 +32,6 @@ class resetPassword extends Mailable implements ShouldQueue
 	// 发件失败处理
 	public function failed(Exception $e)
 	{
-		EmailLog::query()->where('id', $this->id)->update(['status' => -1, 'error' => $e->getMessage()]);
+		NotificationLog::query()->where('id', $this->id)->update(['status' => -1, 'error' => $e->getMessage()]);
 	}
 }

+ 2 - 2
app/Mail/sendUserInfo.php

@@ -2,7 +2,7 @@
 
 namespace App\Mail;
 
-use App\Http\Models\EmailLog;
+use App\Http\Models\NotificationLog;
 use Exception;
 use Illuminate\Bus\Queueable;
 use Illuminate\Contracts\Queue\ShouldQueue;
@@ -32,6 +32,6 @@ class sendUserInfo extends Mailable implements ShouldQueue
 	// 发件失败处理
 	public function failed(Exception $e)
 	{
-		EmailLog::query()->where('id', $this->id)->update(['status' => -1, 'error' => $e->getMessage()]);
+		NotificationLog::query()->where('id', $this->id)->update(['status' => -1, 'error' => $e->getMessage()]);
 	}
 }

+ 2 - 2
app/Mail/sendVerifyCode.php

@@ -2,7 +2,7 @@
 
 namespace App\Mail;
 
-use App\Http\Models\EmailLog;
+use App\Http\Models\NotificationLog;
 use Exception;
 use Illuminate\Bus\Queueable;
 use Illuminate\Contracts\Queue\ShouldQueue;
@@ -32,6 +32,6 @@ class sendVerifyCode extends Mailable implements ShouldQueue
 	// 发件失败处理
 	public function failed(Exception $e)
 	{
-		EmailLog::query()->where('id', $this->id)->update(['status' => -1, 'error' => $e->getMessage()]);
+		NotificationLog::query()->where('id', $this->id)->update(['status' => -1, 'error' => $e->getMessage()]);
 	}
 }

+ 2 - 2
app/Mail/userExpireWarning.php

@@ -2,7 +2,7 @@
 
 namespace App\Mail;
 
-use App\Http\Models\EmailLog;
+use App\Http\Models\NotificationLog;
 use Exception;
 use Illuminate\Bus\Queueable;
 use Illuminate\Contracts\Queue\ShouldQueue;
@@ -32,6 +32,6 @@ class userExpireWarning extends Mailable implements ShouldQueue
 	// 发件失败处理
 	public function failed(Exception $e)
 	{
-		EmailLog::query()->where('id', $this->id)->update(['status' => -1, 'error' => $e->getMessage()]);
+		NotificationLog::query()->where('id', $this->id)->update(['status' => -1, 'error' => $e->getMessage()]);
 	}
 }

+ 2 - 2
app/Mail/userExpireWarningToday.php

@@ -2,7 +2,7 @@
 
 namespace App\Mail;
 
-use App\Http\Models\EmailLog;
+use App\Http\Models\NotificationLog;
 use Exception;
 use Illuminate\Bus\Queueable;
 use Illuminate\Contracts\Queue\ShouldQueue;
@@ -28,6 +28,6 @@ class userExpireWarningToday extends Mailable implements ShouldQueue
 	// 发件失败处理
 	public function failed(Exception $e)
 	{
-		EmailLog::query()->where('id', $this->id)->update(['status' => -1, 'error' => $e->getMessage()]);
+		NotificationLog::query()->where('id', $this->id)->update(['status' => -1, 'error' => $e->getMessage()]);
 	}
 }

+ 2 - 2
app/Mail/userTrafficWarning.php

@@ -2,7 +2,7 @@
 
 namespace App\Mail;
 
-use App\Http\Models\EmailLog;
+use App\Http\Models\NotificationLog;
 use Exception;
 use Illuminate\Bus\Queueable;
 use Illuminate\Contracts\Queue\ShouldQueue;
@@ -32,6 +32,6 @@ class userTrafficWarning extends Mailable implements ShouldQueue
 	// 发件失败处理
 	public function failed(Exception $e)
 	{
-		EmailLog::query()->where('id', $this->id)->update(['status' => -1, 'error' => $e->getMessage()]);
+		NotificationLog::query()->where('id', $this->id)->update(['status' => -1, 'error' => $e->getMessage()]);
 	}
 }

+ 25 - 25
composer.lock

@@ -263,16 +263,16 @@
         },
         {
             "name": "composer/ca-bundle",
-            "version": "1.2.6",
+            "version": "1.2.7",
             "source": {
                 "type": "git",
                 "url": "https://github.com/composer/ca-bundle.git",
-                "reference": "47fe531de31fca4a1b997f87308e7d7804348f7e"
+                "reference": "95c63ab2117a72f48f5a55da9740a3273d45b7fd"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/composer/ca-bundle/zipball/47fe531de31fca4a1b997f87308e7d7804348f7e",
-                "reference": "47fe531de31fca4a1b997f87308e7d7804348f7e",
+                "url": "https://api.github.com/repos/composer/ca-bundle/zipball/95c63ab2117a72f48f5a55da9740a3273d45b7fd",
+                "reference": "95c63ab2117a72f48f5a55da9740a3273d45b7fd",
                 "shasum": "",
                 "mirrors": [
                     {
@@ -321,20 +321,20 @@
                 "ssl",
                 "tls"
             ],
-            "time": "2020-01-13T10:02:55+00:00"
+            "time": "2020-04-08T08:27:21+00:00"
         },
         {
             "name": "composer/composer",
-            "version": "1.10.1",
+            "version": "1.10.5",
             "source": {
                 "type": "git",
                 "url": "https://github.com/composer/composer.git",
-                "reference": "b912a45da3e2b22f5cb5a23e441b697a295ba011"
+                "reference": "7a4d5b6aa30d2118af27c04f5e897b57156ccfa9"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/composer/composer/zipball/b912a45da3e2b22f5cb5a23e441b697a295ba011",
-                "reference": "b912a45da3e2b22f5cb5a23e441b697a295ba011",
+                "url": "https://api.github.com/repos/composer/composer/zipball/7a4d5b6aa30d2118af27c04f5e897b57156ccfa9",
+                "reference": "7a4d5b6aa30d2118af27c04f5e897b57156ccfa9",
                 "shasum": "",
                 "mirrors": [
                     {
@@ -407,7 +407,7 @@
                 "dependency",
                 "package"
             ],
-            "time": "2020-03-13T19:34:27+00:00"
+            "time": "2020-04-10T09:44:22+00:00"
         },
         {
             "name": "composer/semver",
@@ -2659,16 +2659,16 @@
         },
         {
             "name": "mews/purifier",
-            "version": "3.2.1",
+            "version": "3.2.2",
             "source": {
                 "type": "git",
                 "url": "https://github.com/mewebstudio/Purifier.git",
-                "reference": "c70be34e78848ab1771223a771ce7397ddab8c6e"
+                "reference": "75e4d9a0553b31c1fd31aef65f9561c30dbe5e5e"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/mewebstudio/Purifier/zipball/c70be34e78848ab1771223a771ce7397ddab8c6e",
-                "reference": "c70be34e78848ab1771223a771ce7397ddab8c6e",
+                "url": "https://api.github.com/repos/mewebstudio/Purifier/zipball/75e4d9a0553b31c1fd31aef65f9561c30dbe5e5e",
+                "reference": "75e4d9a0553b31c1fd31aef65f9561c30dbe5e5e",
                 "shasum": "",
                 "mirrors": [
                     {
@@ -2739,7 +2739,7 @@
                 "security",
                 "xss"
             ],
-            "time": "2020-03-21T08:50:37+00:00"
+            "time": "2020-04-10T19:42:16+00:00"
         },
         {
             "name": "misechow/geetest",
@@ -3074,16 +3074,16 @@
         },
         {
             "name": "nikic/php-parser",
-            "version": "v4.3.0",
+            "version": "v4.4.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/nikic/PHP-Parser.git",
-                "reference": "9a9981c347c5c49d6dfe5cf826bb882b824080dc"
+                "reference": "bd43ec7152eaaab3bd8c6d0aa95ceeb1df8ee120"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/9a9981c347c5c49d6dfe5cf826bb882b824080dc",
-                "reference": "9a9981c347c5c49d6dfe5cf826bb882b824080dc",
+                "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/bd43ec7152eaaab3bd8c6d0aa95ceeb1df8ee120",
+                "reference": "bd43ec7152eaaab3bd8c6d0aa95ceeb1df8ee120",
                 "shasum": "",
                 "mirrors": [
                     {
@@ -3128,7 +3128,7 @@
                 "parser",
                 "php"
             ],
-            "time": "2019-11-08T13:50:10+00:00"
+            "time": "2020-04-10T16:34:50+00:00"
         },
         {
             "name": "openlss/lib-array2xml",
@@ -5995,16 +5995,16 @@
         },
         {
             "name": "vlucas/phpdotenv",
-            "version": "v3.6.2",
+            "version": "v3.6.3",
             "source": {
                 "type": "git",
                 "url": "https://github.com/vlucas/phpdotenv.git",
-                "reference": "786a947e57086cf236cefdee80784634224b99fa"
+                "reference": "1b3103013797f04521c6cae5560f604649484066"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/786a947e57086cf236cefdee80784634224b99fa",
-                "reference": "786a947e57086cf236cefdee80784634224b99fa",
+                "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/1b3103013797f04521c6cae5560f604649484066",
+                "reference": "1b3103013797f04521c6cae5560f604649484066",
                 "shasum": "",
                 "mirrors": [
                     {
@@ -6060,7 +6060,7 @@
                 "env",
                 "environment"
             ],
-            "time": "2020-03-27T23:36:02+00:00"
+            "time": "2020-04-12T15:18:03+00:00"
         },
         {
             "name": "xhat/payjs",

+ 5 - 5
resources/views/admin/layouts.blade.php

@@ -253,7 +253,7 @@
 					</li>
 				</ul>
 			</li>
-			<li class="site-menu-item has-sub {{in_array(Request::path(), ['admin/trafficLog', 'admin/userTrafficLogList', 'admin/userBanLogList', 'admin/userOnlineIPList', 'admin/onlineIPMonitor', 'admin/emailLog', 'payment/callbackList', 'logs']) ? 'active open' : ''}}">
+			<li class="site-menu-item has-sub {{in_array(Request::path(), ['admin/trafficLog', 'admin/userTrafficLogList', 'admin/userBanLogList', 'admin/userOnlineIPList', 'admin/onlineIPMonitor', 'admin/notificationLog', 'payment/callbackList', 'logs']) ? 'active open' : ''}}">
 				<a href="javascript:void(0)">
 					<i class="site-menu-icon wb-calendar" aria-hidden="true"></i>
 					<span class="site-menu-title">日志系统</span>
@@ -284,9 +284,9 @@
 							<span class="site-menu-title">在线监控</span>
 						</a>
 					</li>
-					<li class="site-menu-item {{in_array(Request::path(), ['admin/emailLog']) ? 'active open' : ''}}">
-						<a href="/admin/emailLog" class="animsition-link">
-							<span class="site-menu-title">邮件投递</span>
+					<li class="site-menu-item {{in_array(Request::path(), ['admin/notificationLog']) ? 'active open' : ''}}">
+						<a href="/admin/notificationLog" class="animsition-link">
+							<span class="site-menu-title">通知记录</span>
 						</a>
 					</li>
 					<li class="site-menu-item {{in_array(Request::path(), ['payment/callbackList']) ? 'active open' : ''}}">
@@ -295,7 +295,7 @@
 						</a>
 					</li>
 					<li class="site-menu-item {{in_array(Request::path(), ['logs']) ? 'active open' : ''}}">
-						<a href="/logs" class="animsition-link">
+						<a href="/logs" class="animsition-link" target="_blank">
 							<span class="site-menu-title">系统运行</span>
 						</a>
 					</li>

+ 3 - 3
resources/views/admin/emailLog.blade.php → resources/views/admin/notificationLog.blade.php

@@ -24,7 +24,7 @@
 					</div>
 					<div class="form-group col-lg-1 col-sm-4 btn-group">
 						<button class="btn btn-primary" onclick="Search()">搜 索</button>
-						<a href="/admin/emailLog" class="btn btn-danger">重 置</a>
+						<a href="/admin/notificationLog" class="btn btn-danger">重 置</a>
 					</div>
 				</div>
 				<table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
@@ -49,7 +49,7 @@
 						@foreach($list as $vo)
 							<tr>
 								<td> {{$vo->id}} </td>
-								<td> {{$vo->type == 1 ? 'Email' : 'serverChan'}} </td>
+								<td> {{$vo->type == 1 ? 'Email' : ($vo->type == 2? 'ServerChan': 'Bark')}} </td>
 								<td> @if($vo->type == 3)
 										<a href="/b/{{$vo->code}}" target="_blank">{{$vo->code}}</a> @endif </td>
 								<td> {{$vo->address}} </td>
@@ -92,7 +92,7 @@
 	<script type="text/javascript">
         // 搜索
         function Search() {
-            window.location.href = '/admin/emailLog?email=' + $("#email").val() + '&type=' + $("#type option:selected").val();
+            window.location.href = '/admin/notificationLog?email=' + $("#email").val() + '&type=' + $("#type option:selected").val();
         }
 	</script>
 @endsection

+ 156 - 102
resources/views/admin/system.blade.php

@@ -73,7 +73,7 @@
 											<label class="col-md-3" for="website_name">网站名称</label>
 											<div class="col-md-6">
 												<div class="input-group">
-													<input type="text" class="form-control" name="website_name" id="website_name" value="{{$website_name}}"/>
+													<input type="text" class="form-control" id="website_name" value="{{$website_name}}"/>
 													<span class="input-group-append"><button class="btn btn-primary" type="button" onclick="update('website_name')">修改</button></span>
 												</div>
 											</div>
@@ -85,7 +85,7 @@
 											<label class="col-md-3 col-form-label" for="website_url">网站地址</label>
 											<div class="col-md-6">
 												<div class="input-group">
-													<input type="url" class="form-control" name="website_url" id="website_url" value="{{$website_url}}"/>
+													<input type="url" class="form-control" id="website_url" value="{{$website_url}}"/>
 													<span class="input-group-append"><button class="btn btn-primary" type="button" onclick="update('website_url')">修改</button></span>
 												</div>
 											</div>
@@ -97,7 +97,7 @@
 											<label class="col-md-3 col-form-label" for="AppStore_id">苹果账号</label>
 											<div class="col-md-6">
 												<div class="input-group">
-													<input type="email" class="form-control" name="AppStore_id" id="AppStore_id" value="{{$AppStore_id}}"/>
+													<input type="email" class="form-control" id="AppStore_id" value="{{$AppStore_id}}"/>
 													<span class="input-group-append"><button class="btn btn-primary" type="button" onclick="update('AppStore_id')">修改</button></span>
 												</div>
 											</div>
@@ -109,7 +109,7 @@
 											<label class="col-md-3 col-form-label" for="AppStore_password">苹果密码</label>
 											<div class="col-md-6">
 												<div class="input-group">
-													<input type="password" class="form-control" name="AppStore_password" id="AppStore_password" value="{{$AppStore_password}}"/>
+													<input type="password" class="form-control" id="AppStore_password" value="{{$AppStore_password}}"/>
 													<span class="input-group-append"><button class="btn btn-primary" type="button" onclick="update('AppStore_password')">修改</button></span>
 												</div>
 											</div>
@@ -121,7 +121,7 @@
 											<label class="col-md-3 col-form-label" for="webmaster_email">管理员邮箱</label>
 											<div class="col-md-6">
 												<div class="input-group">
-													<input type="email" class="form-control" name="webmaster_email" id="webmaster_email" value="{{$webmaster_email}}"/>
+													<input type="email" class="form-control" id="webmaster_email" value="{{$webmaster_email}}"/>
 													<span class="input-group-append"><button class="btn btn-primary" type="button" onclick="update('webmaster_email')">修改</button></span>
 												</div>
 											</div>
@@ -133,7 +133,7 @@
 											<label class="col-md-3 col-form-label" for="website_security_code">网站安全码</label>
 											<div class="col-md-6">
 												<div class="input-group">
-													<input type="text" class="form-control" name="website_security_code" id="website_security_code" value="{{$website_security_code}}"/>
+													<input type="text" class="form-control" id="website_security_code" value="{{$website_security_code}}"/>
 													<span class="input-group-append">
 														<button class="btn btn-info" type="button" onclick="makeWebsiteSecurityCode()">生成</button>
 														<button class="btn btn-primary" type="button" onclick="update('website_security_code')">修改</button>
@@ -176,7 +176,7 @@
 											<label class="col-md-3" for="maintenance_time">维护结束时间</label>
 											<div class="col-md-6">
 												<div class="input-group">
-													<input type="datetime-local" class="form-control" name="maintenance_time" id="maintenance_time" value="{{$maintenance_time}}" />
+													<input type="datetime-local" class="form-control" id="maintenance_time" value="{{$maintenance_time}}"/>
 													<span class="input-group-append"><button class="btn btn-primary" type="button" onclick="update('maintenance_time')">修改</button></span>
 												</div>
 											</div>
@@ -188,7 +188,7 @@
 											<label class="col-md-3" for="maintenance_content">维护介绍内容</label>
 											<div class="col-md-6">
 												<div class="input-group">
-													<textarea class="form-control" rows="3" name="maintenance_content" id="maintenance_content">{{$maintenance_content}}</textarea>
+													<textarea class="form-control" rows="3" id="maintenance_content">{{$maintenance_content}}</textarea>
 													<span class="input-group-append"><button class="btn btn-primary" type="button" onclick="update('maintenance_content')">修改</button></span>
 												</div>
 											</div>
@@ -211,25 +211,34 @@
 									<div class="form-group col-lg-6">
 										<div class="row">
 											<label class="col-md-3 col-form-label" for="is_invite_register">邀请注册</label>
-											<select class="col-md-3" name="is_invite_register" id="is_invite_register" data-plugin="selectpicker" data-style="btn-outline btn-primary" onchange="updateFromOther('select','is_invite_register')">
-												<option value="0" @if($is_invite_register == '0') selected @endif>关闭</option>
-												<option value="1" @if($is_invite_register == '1') selected @endif>可选</option>
-												<option value="2" @if($is_invite_register == '2') selected @endif>必须</option>
+											<select class="col-md-3" id="is_invite_register" data-plugin="selectpicker" data-style="btn-outline btn-primary" onchange="updateFromOther('select','is_invite_register')">
+												<option value="0">关闭</option>
+												<option value="1">可选</option>
+												<option value="2">必须</option>
 											</select>
 										</div>
 									</div>
 									<div class="form-group col-lg-6">
 										<div class="row">
-											<label class="col-md-3 col-form-label" for="is_active_register">激活账号</label>
-											<span class="col-md-9"><input type="checkbox" id="is_active_register" data-plugin="switchery" @if($is_active_register) checked @endif onchange="updateFromOther('switch','is_active_register')"></span>
+											<label class="col-md-3 col-form-label" for="is_activate_account">激活账号</label>
+											<select class="col-md-3" id="is_activate_account" data-plugin="selectpicker" data-style="btn-outline btn-primary" onchange="updateFromOther('select','is_activate_account')">
+												<option value="0">关闭</option>
+												<option value="1">注册前激活</option>
+												<option value="2">注册后激活</option>
+											</select>
 											<span class="text-help offset-md-3"> 启用后用户需要通过邮件来激活账号 </span>
 										</div>
 									</div>
 									<div class="form-group col-lg-6">
 										<div class="row">
-											<label class="col-md-3 col-form-label" for="is_verify_register">注册校验验证码</label>
-											<span class="col-md-9"><input type="checkbox" id="is_verify_register" data-plugin="switchery" @if($is_verify_register) checked @endif onchange="updateFromOther('switch','is_verify_register')"></span>
-											<span class="text-help offset-md-3"> 注册时需要先通过邮件获取验证码方可注册,‘激活账号’失效 </span>
+											<label class="col-md-3 col-form-label" for="is_captcha">验证码</label>
+											<select class="col-md-5" id="is_captcha" data-plugin="selectpicker" data-style="btn-outline btn-primary" onchange="updateFromOther('select','is_captcha')">
+												<option value="0">关闭</option>
+												<option value="1">普通验证码</option>
+												<option value="2">极验Geetest</option>
+												<option value="3">Google reCAPTCHA</option>
+											</select>
+											<span class="text-help offset-md-3"> 启用后登录、注册需要输入验证码 </span>
 										</div>
 									</div>
 									<div class="form-group col-lg-6">
@@ -239,18 +248,6 @@
 											<span class="text-help offset-md-3"> 启用后用户可以通过邮件重置密码 </span>
 										</div>
 									</div>
-									<div class="form-group col-lg-6">
-										<div class="row">
-											<label class="col-md-3 col-form-label" for="is_captcha">验证码</label>
-											<select class="col-md-5" name="is_captcha" id="is_captcha" data-plugin="selectpicker" data-style="btn-outline btn-primary" onchange="updateFromOther('select','is_captcha')">
-												<option value="0" @if($is_captcha == '0') selected @endif>关闭</option>
-												<option value="1" @if($is_captcha == '1') selected @endif>普通验证码</option>
-												<option value="2" @if($is_captcha == '2') selected @endif>极验Geetest</option>
-												<option value="3" @if($is_captcha == '3') selected @endif>Google reCAPTCHA</option>
-											</select>
-											<span class="text-help offset-md-3"> 启用后登录、注册需要输入验证码 </span>
-										</div>
-									</div>
 									<div class="form-group col-lg-6">
 										<div class="row">
 											<label class="col-md-3 col-form-label" for="is_free_code">免费邀请码</label>
@@ -271,12 +268,12 @@
 											<div class="col-md-7">
 												<div class="input-group">
 													<label for="min_port"></label>
-													<input type="number" class="form-control" name="min_port" id="min_port" value="{{$min_port}}" onchange="updateFromInput('min_port','1000','{{$max_port}}')"/>
+													<input type="number" class="form-control" id="min_port" value="{{$min_port}}" onchange="updateFromInput('min_port','1000','{{$max_port}}')"/>
 													<div class="input-group-prepend">
 														<span class="input-group-text"> ~ </span>
 													</div>
 													<label for="max_port"></label>
-													<input type="number" class="form-control" name="max_port" id="max_port" value="{{$max_port}}" onchange="updateFromInput('max_port','{{$max_port}}','65535')"/>
+													<input type="number" class="form-control" id="max_port" value="{{$max_port}}" onchange="updateFromInput('max_port','{{$max_port}}','65535')"/>
 												</div>
 											</div>
 											<span class="text-help offset-md-3"> 端口范围:1000 - 65535 </span>
@@ -294,7 +291,7 @@
 											<label class="col-md-3 col-form-label" for="default_days">初始有效期</label>
 											<div class="col-md-7">
 												<div class="input-group">
-													<input type="number" class="form-control" name="default_days" id="default_days" value="{{$default_days}}"/>
+													<input type="number" class="form-control" id="default_days" value="{{$default_days}}"/>
 													<div class="input-group-append">
 													</div>
 													<span class="input-group-text">天</span>
@@ -309,7 +306,7 @@
 											<label class="col-md-3 col-form-label" for="default_traffic">初始流量</label>
 											<div class="col-md-7">
 												<div class="input-group">
-													<input type="number" class="form-control" name="default_traffic" id="default_traffic" value="{{$default_traffic}}"/>
+													<input type="number" class="form-control" id="default_traffic" value="{{$default_traffic}}"/>
 													<div class="input-group-append">
 													</div>
 													<span class="input-group-text">MB</span>
@@ -324,7 +321,7 @@
 											<label class="col-md-3 col-form-label" for="invite_num">可生成邀请码数</label>
 											<div class="col-md-7">
 												<div class="input-group">
-													<input type="number" class="form-control" name="invite_num" id="invite_num" value="{{$invite_num}}"/>
+													<input type="number" class="form-control" id="invite_num" value="{{$invite_num}}"/>
 													<span class="input-group-append"><button class="btn btn-primary" type="button" onclick="updateFromInput('invite_num','0')">修改</button></span>
 												</div>
 											</div>
@@ -336,7 +333,7 @@
 											<label class="col-md-3 col-form-label" for="reset_password_times">重置密码次数</label>
 											<div class="col-md-7">
 												<div class="input-group">
-													<input type="number" class="form-control" name="reset_password_times" id="reset_password_times" value="{{$reset_password_times}}"/>
+													<input type="number" class="form-control" id="reset_password_times" value="{{$reset_password_times}}"/>
 													<span class="input-group-append"><button class="btn btn-primary" type="button" onclick="updateFromInput('reset_password_times','0')">修改</button></span>
 												</div>
 											</div>
@@ -345,9 +342,13 @@
 									</div>
 									<div class="form-group col-lg-6">
 										<div class="row">
-											<label class="col-md-3 col-form-label" for="sensitiveType">邮箱过滤机制</label>
-											<span class="col-md-9"><input type="checkbox" id="sensitiveType" data-plugin="switchery" @if($sensitiveType) checked @endif onchange="updateFromOther('switch','sensitiveType')"></span>
-											<span class="text-help offset-md-3"> 开启为黑名单,用户可使用任意黑名单外的邮箱注册;关闭为白名单,用户只能选择使用白名单中的邮箱后缀注册 </span>
+											<label class="col-md-3 col-form-label" for="is_email_filtering">邮箱过滤机制</label>
+											<select class="col-md-3" id="is_email_filtering" data-plugin="selectpicker" data-style="btn-outline btn-primary" onchange="updateFromOther('select','is_email_filtering')">
+												<option value="0">关闭</option>
+												<option value="1">黑名单</option>
+												<option value="2">白名单</option>
+											</select>
+											<span class="text-help offset-md-3"> 黑名单: 用户可使用任意黑名单外的邮箱注册;白名单: 用户只能选择使用白名单中的邮箱后缀注册 </span>
 										</div>
 									</div>
 									<div class="form-group col-lg-6">
@@ -355,7 +356,7 @@
 											<label class="col-md-3 col-form-label" for="active_times">激活账号次数</label>
 											<div class="col-md-7">
 												<div class="input-group">
-													<input type="number" class="form-control" name="active_times" id="active_times" value="{{$active_times}}"/>
+													<input type="number" class="form-control" id="active_times" value="{{$active_times}}"/>
 													<span class="input-group-append"><button class="btn btn-primary" type="button" onclick="updateFromInput('active_times','0')">修改</button></span>
 												</div>
 											</div>
@@ -367,7 +368,7 @@
 											<label class="col-md-3 col-form-label" for="register_ip_limit">同IP注册限制</label>
 											<div class="col-md-7">
 												<div class="input-group">
-													<input type="number" class="form-control" name="register_ip_limit" id="register_ip_limit" value="{{$register_ip_limit}}"/>
+													<input type="number" class="form-control" id="register_ip_limit" value="{{$register_ip_limit}}"/>
 													<span class="input-group-append"><button class="btn btn-primary" type="button" onclick="updateFromInput('register_ip_limit','0')">修改</button></span>
 												</div>
 											</div>
@@ -377,9 +378,9 @@
 									<div class="form-group col-lg-6">
 										<div class="row">
 											<label class="col-md-3 col-form-label" for="initial_labels_for_user">用户初始标签</label>
-											<select class="col-md-7 show-tick" name="initial_labels_for_user" id="initial_labels_for_user" data-plugin="selectpicker" data-style="btn-outline btn-primary" onchange="updateFromOther('multiSelect','initial_labels_for_user')" multiple>
+											<select class="col-md-7 show-tick" id="initial_labels_for_user" data-plugin="selectpicker" data-style="btn-outline btn-primary" onchange="updateFromOther('multiSelect','initial_labels_for_user')" multiple>
 												@foreach($label_list as $label)
-													<option value="{{$label->id}}" @if(in_array($label->id, explode(',', $initial_labels_for_user))) selected @endif>{{$label->name}}</option>
+													<option value="{{$label->id}}">{{$label->name}}</option>
 												@endforeach
 											</select>
 											<span class="text-help offset-md-3"> 注册用户时的初始标签,标签用于关联节点 </span>
@@ -390,7 +391,7 @@
 											<label class="col-md-3 col-form-label" for="user_invite_days">用户-邀请码有效期</label>
 											<div class="col-md-7">
 												<div class="input-group">
-													<input type="number" class="form-control" name="user_invite_days" id="user_invite_days" value="{{$user_invite_days}}"/>
+													<input type="number" class="form-control" id="user_invite_days" value="{{$user_invite_days}}"/>
 													<div class="input-group-append">
 													</div>
 													<span class="input-group-text">天</span>
@@ -411,7 +412,7 @@
 											<label class="col-md-3 col-form-label" for="subscribe_domain">节点订阅地址</label>
 											<div class="col-md-7">
 												<div class="input-group">
-													<input type="url" class="form-control" name="subscribe_domain" id="subscribe_domain" value="{{$subscribe_domain}}"/>
+													<input type="url" class="form-control" id="subscribe_domain" value="{{$subscribe_domain}}"/>
 													<span class="input-group-append"><button class="btn btn-primary" type="button" onclick="update('subscribe_domain')">修改</button></span>
 												</div>
 											</div>
@@ -423,7 +424,7 @@
 											<label class="col-md-3 col-form-label" for="subscribe_max">订阅节点数</label>
 											<div class="col-md-7">
 												<div class="input-group">
-													<input type="number" class="form-control" name="subscribe_max" id="subscribe_max" value="{{$subscribe_max}}"/>
+													<input type="number" class="form-control" id="subscribe_max" value="{{$subscribe_max}}"/>
 													<span class="input-group-append"><button class="btn btn-primary" type="button" onclick="updateFromInput('subscribe_max','0')">修改</button></span>
 												</div>
 											</div>
@@ -469,7 +470,7 @@
 											<label class="col-md-3 col-form-label" for="namesilo_key">Namesilo API KEY</label>
 											<div class="col-md-7">
 												<div class="input-group">
-													<input type="text" class="form-control" name="namesilo_key" id="namesilo_key" value="{{$namesilo_key}}" placeholder="填入Namesilo上申请的API KEY"/>
+													<input type="text" class="form-control" id="namesilo_key" value="{{$namesilo_key}}" placeholder="填入Namesilo上申请的API KEY"/>
 													<span class="input-group-append"><button class="btn btn-primary" type="button" onclick="update('namesilo_key')">修改</button></span>
 												</div>
 											</div>
@@ -481,7 +482,7 @@
 											<label class="col-md-3 col-form-label" for="admin_invite_days">管理员-邀请码有效期</label>
 											<div class="col-md-7">
 												<div class="input-group">
-													<input type="number" class="form-control" name="admin_invite_days" id="admin_invite_days" value="{{$admin_invite_days}}"/>
+													<input type="number" class="form-control" id="admin_invite_days" value="{{$admin_invite_days}}"/>
 													<div class="input-group-append">
 													</div>
 													<span class="input-group-text">天</span>
@@ -497,7 +498,7 @@
 												<label class="col-md-3 col-form-label" for="geetest_id">极验ID</label>
 												<div class="col-md-7">
 													<div class="input-group">
-														<input type="text" class="form-control" name="geetest_id" id="geetest_id" value="{{$geetest_id}}"/>
+														<input type="text" class="form-control" id="geetest_id" value="{{$geetest_id}}"/>
 														<span class="input-group-append"><button class="btn btn-primary" type="button" onclick="update('geetest_id')">修改</button></span>
 													</div>
 												</div>
@@ -509,7 +510,7 @@
 												<label class="col-md-3 col-form-label" for="geetest_key">极验KEY</label>
 												<div class="col-md-7">
 													<div class="input-group">
-														<input type="text" class="form-control" name="geetest_key" id="geetest_key" value="{{$geetest_key}}"/>
+														<input type="text" class="form-control" id="geetest_key" value="{{$geetest_key}}"/>
 														<span class="input-group-append"><button class="btn btn-primary" type="button" onclick="update('geetest_key')">修改</button></span>
 													</div>
 												</div>
@@ -521,7 +522,7 @@
 												<label class="col-md-3 col-form-label" for="google_captcha_sitekey">网站密钥</label>
 												<div class="col-md-7">
 													<div class="input-group">
-														<input type="text" class="form-control" name="google_captcha_sitekey" id="google_captcha_sitekey" value="{{$google_captcha_sitekey}}"/>
+														<input type="text" class="form-control" id="google_captcha_sitekey" value="{{$google_captcha_sitekey}}"/>
 														<span class="input-group-append"><button class="btn btn-primary" type="button" onclick="update('google_captcha_sitekey')">修改</button></span>
 													</div>
 												</div>
@@ -533,7 +534,7 @@
 												<label class="col-md-3 control-label" for="google_captcha_secret">密钥</label>
 												<div class="col-md-7">
 													<div class="input-group">
-														<input type="text" class="form-control" name="google_captcha_secret" id="google_captcha_secret" value="{{$google_captcha_secret}}"/>
+														<input type="text" class="form-control" id="google_captcha_secret" value="{{$google_captcha_secret}}"/>
 														<span class="input-group-append"><button class="btn btn-primary" type="button" onclick="update('google_captcha_secret')">修改</button></span>
 													</div>
 												</div>
@@ -558,7 +559,7 @@
 											<label class="col-md-3 col-form-label" for="traffic_limit_time">时间间隔</label>
 											<div class="col-md-7">
 												<div class="input-group">
-													<input type="number" class="form-control" name="traffic_limit_time" id="traffic_limit_time" value="{{$traffic_limit_time}}"/>
+													<input type="number" class="form-control" id="traffic_limit_time" value="{{$traffic_limit_time}}"/>
 													<div class="input-group-append">
 													</div>
 													<span class="input-group-text">分钟</span>
@@ -574,12 +575,12 @@
 											<div class="col-md-7">
 												<div class="input-group">
 													<label for="min_rand_traffic"></label>
-													<input type="number" class="form-control" name="min_rand_traffic" id="min_rand_traffic" value="{{$min_rand_traffic}}" onchange="updateFromInput('min_rand_traffic','0','{{$max_rand_traffic}}')"/>
+													<input type="number" class="form-control" id="min_rand_traffic" value="{{$min_rand_traffic}}" onchange="updateFromInput('min_rand_traffic','0','{{$max_rand_traffic}}')"/>
 													<div class="input-group-prepend">
 														<span class="input-group-text"> ~ </span>
 													</div>
 													<label for="max_rand_traffic"></label>
-													<input type="number" class="form-control" name="max_rand_traffic" id="max_rand_traffic" value="{{$max_rand_traffic}}" onchange="updateFromInput('max_rand_traffic','0','{{$min_rand_traffic}}')"/>
+													<input type="number" class="form-control" id="max_rand_traffic" value="{{$max_rand_traffic}}" onchange="updateFromInput('max_rand_traffic','0','{{$min_rand_traffic}}')"/>
 													<div class="input-group-prepend">
 														<span class="input-group-text"> MB </span>
 													</div>
@@ -609,7 +610,7 @@
 											<label class="col-md-3 col-form-label" for="referral_traffic">注册送流量</label>
 											<div class="col-md-7">
 												<div class="input-group">
-													<input type="number" class="form-control" name="referral_traffic" id="referral_traffic" value="{{$referral_traffic}}"/>
+													<input type="number" class="form-control" id="referral_traffic" value="{{$referral_traffic}}"/>
 													<div class="input-group-append">
 														<span class="input-group-text">MB</span>
 														<button class="btn btn-primary" type="button" onclick="updateFromInput('referral_traffic','0')">修改</button>
@@ -624,7 +625,7 @@
 											<label class="col-md-3 col-form-label" for="referral_percent">返利比例</label>
 											<div class="col-md-7">
 												<div class="input-group">
-													<input type="number" class="form-control" name="referral_percent" id="referral_percent" value="{{$referral_percent * 100}}"/>
+													<input type="number" class="form-control" id="referral_percent" value="{{$referral_percent * 100}}"/>
 													<div class="input-group-append">
 														<span class="input-group-text">%</span>
 														<button class="btn btn-primary" type="button" onchange="updateFromInput('referral_percent','0','100')">修改</button>
@@ -639,7 +640,7 @@
 											<label class="col-md-3 col-form-label" for="referral_money">提现限制</label>
 											<div class="col-md-7">
 												<div class="input-group">
-													<input type="number" class="form-control" name="referral_money" id="referral_money" value="{{$referral_money}}"/>
+													<input type="number" class="form-control" id="referral_money" value="{{$referral_money}}"/>
 													<div class="input-group-append">
 														<span class="input-group-text">元</span>
 														<button class="btn btn-primary" type="button" onclick="updateFromInput('referral_money','0')">修改</button>
@@ -667,7 +668,7 @@
 											<label class="col-md-3 col-form-label" for="expire_days">过期警告阈值</label>
 											<div class="col-md-7">
 												<div class="input-group">
-													<input type="number" class="form-control" name="expire_days" id="expire_days" value="{{$expire_days}}"/>
+													<input type="number" class="form-control" id="expire_days" value="{{$expire_days}}"/>
 													<div class="input-group-append">
 														<span class="input-group-text">天</span>
 														<button class="btn btn-primary" type="button" onclick="updateFromInput('expire_days','0')">修改</button>
@@ -689,7 +690,7 @@
 											<label for="traffic_warning_percent" class="col-md-3 col-form-label">流量警告阈值</label>
 											<div class="col-md-7">
 												<div class="input-group">
-													<input type="number" class="form-control" name="traffic_warning_percent" id="traffic_warning_percent" value="{{$traffic_warning_percent}}"/>
+													<input type="number" class="form-control" id="traffic_warning_percent" value="{{$traffic_warning_percent}}"/>
 													<div class="input-group-append">
 														<span class="input-group-text">%</span>
 														<button class="btn btn-primary" type="button" onclick="updateFromInput('traffic_warning_percent','0')">修改</button>
@@ -701,9 +702,24 @@
 									</div>
 									<div class="form-group col-lg-6">
 										<div class="row">
-											<label class="col-md-3 col-form-label" for="is_node_crash_warning">节点离线提醒</label>
-											<span class="col-md-9"><input type="checkbox" id="is_node_crash_warning" data-plugin="switchery" @if($is_node_crash_warning) checked @endif onchange="updateFromOther('switch','is_node_crash_warning')"></span>
-											<span class="text-help offset-md-3"> 启用后如果节点离线则通过ServerChan推送提醒 </span>
+											<label class="col-md-3 col-form-label" for="is_node_offline">节点离线提醒</label>
+											<span class="col-md-9"><input type="checkbox" id="is_node_offline" data-plugin="switchery" @if($is_node_offline) checked @endif onchange="updateFromOther('switch','is_node_offline')"></span>
+											<span class="text-help offset-md-3"> 启用后如果节点离线会推送提醒 </span>
+										</div>
+									</div>
+									<div class="form-group col-lg-6">
+										<div class="row">
+											<label class="col-md-3 col-form-label" for="offline_check_times">离线提醒次数</label>
+											<div class="col-md-7">
+												<div class="input-group">
+													<input type="number" class="form-control" id="offline_check_times" value="{{$offline_check_times}}"/>
+													<div class="input-group-append">
+														<span class="input-group-text">次</span>
+														<button class="btn btn-primary" type="button" onclick="updateFromInput('offline_check_times','0','60')">修改</button>
+													</div>
+												</div>
+											</div>
+											<span class="text-help offset-md-3"> 提醒几次后不再提醒,为0时不限制,不超过60 </span>
 										</div>
 									</div>
 									<div class="form-group col-lg-6">
@@ -715,13 +731,13 @@
 									</div>
 									<div class="form-group col-lg-6">
 										<div class="row">
-											<label class="col-md-3 col-form-label" for="numberOfWarningTimes">阻断检测提醒</label>
+											<label class="col-md-3 col-form-label" for="detection_check_times">阻断检测提醒</label>
 											<div class="col-md-7">
 												<div class="input-group">
-													<input type="number" class="form-control" name="numberOfWarningTimes" id="numberOfWarningTimes" value="{{$numberOfWarningTimes}}"/>
+													<input type="number" class="form-control" id="detection_check_times" value="{{$detection_check_times}}"/>
 													<div class="input-group-append">
 														<span class="input-group-text">次</span>
-														<button class="btn btn-primary" type="button" onclick="updateFromInput('numberOfWarningTimes','0','12')">修改</button>
+														<button class="btn btn-primary" type="button" onclick="updateFromInput('detection_check_times','0','12')">修改</button>
 													</div>
 												</div>
 											</div>
@@ -730,9 +746,13 @@
 									</div>
 									<div class="form-group col-lg-6">
 										<div class="row">
-											<label class="col-md-3 col-form-label" for="is_server_chan">ServerChan</label>
-											<span class="col-md-9"><input type="checkbox" id="is_server_chan" data-plugin="switchery" @if($is_server_chan) checked @endif onchange="updateFromOther('switch','is_server_chan')"></span>
-											<span class="text-help offset-md-3"> 推送节点离线提醒、用户流量异常警告、节点使用报告(<a href="http://sc.ftqq.com" target="_blank">绑定微信</a>) </span>
+											<label class="col-md-3 col-form-label" for="is_notification">推送通知</label>
+											<select class="col-md-5" id="is_notification" data-plugin="selectpicker" data-style="btn-outline btn-primary" onchange="updateFromOther('select','is_notification')">
+												<option value="0">关闭</option>
+												<option value="1">ServerChan</option>
+												<option value="2">Bark</option>
+											</select>
+											<span class="text-help offset-md-3"> 推送节点离线提醒、用户流量异常警告、节点使用报告(<a href="javascript:sendTestNotification();">发送测试消息</a>)</span>
 										</div>
 									</div>
 									<div class="form-group col-lg-6">
@@ -740,13 +760,25 @@
 											<label class="col-md-3 col-form-label" for="server_chan_key">SCKEY</label>
 											<div class="col-md-7">
 												<div class="input-group">
-													<input type="text" class="form-control" name="server_chan_key" id="server_chan_key" value="{{$server_chan_key}}" placeholder="请到ServerChan申请"/>
+													<input type="text" class="form-control" id="server_chan_key" value="{{$server_chan_key}}" placeholder="请到ServerChan申请"/>
 													<span class="input-group-append"><button class="btn btn-primary" type="button" onclick="update('server_chan_key')">修改</button></span>
 												</div>
 											</div>
 											<span class="text-help offset-md-3"> 启用ServerChan,请务必填入本值(<a href="http://sc.ftqq.com" target="_blank">申请SCKEY</a>) </span>
 										</div>
 									</div>
+									<div class="form-group col-lg-6">
+										<div class="row">
+											<label class="col-md-3 col-form-label" for="bark_key">Bark设备号</label>
+											<div class="col-md-7">
+												<div class="input-group">
+													<input type="url" class="form-control" id="bark_key" value="{{$bark_key}}" placeholder="安装并打开Bark后取得"/>
+													<span class="input-group-append"><button class="btn btn-primary" type="button" onclick="update('bark_key')">修改</button></span>
+												</div>
+											</div>
+											<span class="text-help offset-md-3"> 推送消息到iOS设备,需要在iOS设备里装一个名为Bark的应用,取网址后的一长串代码,启用Bark,请务必填入本值 </span>
+										</div>
+									</div>
 									<div class="form-group col-lg-6">
 										<div class="row">
 											<label class="col-md-3 col-form-label" for="is_push_bear">PushBear</label>
@@ -759,7 +791,7 @@
 											<label class="col-md-3 col-form-label" for="push_bear_send_key">PushBear SendKey</label>
 											<div class="col-md-7">
 												<div class="input-group">
-													<input type="text" class="form-control" name="push_bear_send_key" id="push_bear_send_key" value="{{$push_bear_send_key}}" placeholder="创建消息通道后即可获取"/>
+													<input type="text" class="form-control" id="push_bear_send_key" value="{{$push_bear_send_key}}" placeholder="创建消息通道后即可获取"/>
 													<span class="input-group-append"><button class="btn btn-primary" type="button" onclick="update('push_bear_send_key')">修改</button></span>
 												</div>
 											</div>
@@ -771,7 +803,7 @@
 											<label class="col-md-3 col-form-label" for="push_bear_qrcode">PushBear订阅二维码</label>
 											<div class="col-md-7">
 												<div class="input-group">
-													<input type="url" class="form-control" name="push_bear_qrcode" id="push_bear_qrcode" value="{{$push_bear_qrcode}}" placeholder="填入消息通道的二维码URL"/>
+													<input type="url" class="form-control" id="push_bear_qrcode" value="{{$push_bear_qrcode}}" placeholder="填入消息通道的二维码URL"/>
 													<span class="input-group-append"><button class="btn btn-primary" type="button" onclick="update('push_bear_qrcode')">修改</button></span>
 												</div>
 											</div>
@@ -810,7 +842,7 @@
 											<label class="col-md-3 col-form-label" for="subscribe_ban_times">订阅请求阈值</label>
 											<div class="col-md-7">
 												<div class="input-group">
-													<input type="number" class="form-control" name="subscribe_ban_times" id="subscribe_ban_times" value="{{$subscribe_ban_times}}"/>
+													<input type="number" class="form-control" id="subscribe_ban_times" value="{{$subscribe_ban_times}}"/>
 													<span class="input-group-append"><button class="btn btn-primary" type="button" onclick="updateFromInput('subscribe_ban_times','0')">修改</button></span>
 												</div>
 											</div>
@@ -829,7 +861,7 @@
 											<label class="col-md-3 col-form-label" for="traffic_ban_value">流量异常阈值</label>
 											<div class="col-md-7">
 												<div class="input-group">
-													<input type="number" class="form-control" name="traffic_ban_value" id="traffic_ban_value" value="{{$traffic_ban_value}}"/>
+													<input type="number" class="form-control" id="traffic_ban_value" value="{{$traffic_ban_value}}"/>
 													<div class="input-group-append">
 														<span class="input-group-text">GB</span>
 														<button class="btn btn-primary" type="button" onclick="updateFromInput('traffic_ban_value', '1')">修改</button>
@@ -844,7 +876,7 @@
 											<label class="col-md-3 col-form-label" for="traffic_ban_time">封号时长</label>
 											<div class="col-md-7">
 												<div class="input-group">
-													<input type="number" class="form-control" name="traffic_ban_time" id="traffic_ban_time" value="{{$traffic_ban_time}}"/>
+													<input type="number" class="form-control" id="traffic_ban_time" value="{{$traffic_ban_time}}"/>
 													<div class="input-group-append">
 														<span class="input-group-text">分钟</span>
 														<button class="btn btn-primary" type="button" onclick="updateFromInput('traffic_ban_time', '0')">修改</button>
@@ -886,7 +918,7 @@
 										<div class="row">
 											<label class="col-form-label col-md-3" for="website_home_logo">首页LOGO</label>
 											<div class="col-md-9">
-												<input type="file" name="website_home_logo" id="website_home_logo" data-plugin="dropify" data-default-file={{$website_home_logo?:'/assets/images/noimage.png'}} />
+												<input type="file" id="website_home_logo" data-plugin="dropify" data-default-file={{$website_home_logo?:'/assets/images/noimage.png'}} />
 												<button type="submit" class="btn btn-success float-right mt-10"> 提 交</button>
 											</div>
 										</div>
@@ -895,7 +927,7 @@
 										<div class="row">
 											<label class="col-form-label col-md-3" for="website_logo">站内LOGO</label>
 											<div class="col-md-9">
-												<input type="file" name="website_logo" id="website_logo" data-plugin="dropify" data-default-file={{$website_logo?:'/assets/images/noimage.png'}} />
+												<input type="file" id="website_logo" data-plugin="dropify" data-default-file={{$website_logo?:'/assets/images/noimage.png'}} />
 												<button type="submit" class="btn btn-success float-right mt-10"> 提 交</button>
 											</div>
 										</div>
@@ -904,7 +936,7 @@
 										<div class="row">
 											<label class="col-form-label col-md-3" for="website_analytics">统计代码</label>
 											<div class="col-md-9">
-												<textarea class="form-control" rows="10" name="website_analytics" id="website_analytics">{{$website_analytics}}</textarea>
+												<textarea class="form-control" rows="10" id="website_analytics">{{$website_analytics}}</textarea>
 												<button type="submit" class="btn btn-success float-right mt-10"> 提 交</button>
 											</div>
 										</div>
@@ -913,7 +945,7 @@
 										<div class="row">
 											<label class="col-form-label col-md-3" for="website_customer_service">客服代码</label>
 											<div class="col-md-9">
-												<textarea class="form-control" rows="10" name="website_customer_service" id="website_customer_service">{{$website_customer_service}}</textarea>
+												<textarea class="form-control" rows="10" id="website_customer_service">{{$website_customer_service}}</textarea>
 												<button type="submit" class="btn btn-success float-right mt-10"> 提 交</button>
 											</div>
 										</div>
@@ -934,29 +966,29 @@
 									<div class="form-group col-lg-6">
 										<div class="row">
 											<label class="col-md-3 col-form-label" for="alipay_currency">结算币种</label>
-											<select class="col-md-5" name="alipay_currency" id="alipay_currency" data-plugin="selectpicker" data-style="btn-outline btn-primary" onchange="updateFromOther('select','alipay_currency')">
-												<option value="USD" @if($alipay_currency == 'USD') selected @endif>美元</option>
-												<option value="HKD" @if($alipay_currency == 'HKD') selected @endif>港币</option>
-												<option value="JPY" @if($alipay_currency == 'JPY') selected @endif>日元</option>
-												<option value="EUR" @if($alipay_currency == 'EUR') selected @endif>欧元</option>
+											<select class="col-md-5" id="alipay_currency" data-plugin="selectpicker" data-style="btn-outline btn-primary" onchange="updateFromOther('select','alipay_currency')">
+												<option value="USD">美元</option>
+												<option value="HKD">港币</option>
+												<option value="JPY">日元</option>
+												<option value="EUR">欧元</option>
 											</select>
 										</div>
 									</div>
 									<div class="form-group col-lg-6">
 										<div class="row">
 											<label class="col-md-3 col-form-label" for="alipay_sign_type">加密方式</label>
-											<select class="col-md-5" name="alipay_sign_type" id="alipay_sign_type" data-plugin="selectpicker" data-style="btn-outline btn-primary" onchange="updateFromOther('select','alipay_sign_type')">
-												<option value="MD5" @if($alipay_sign_type == 'MD5') selected @endif>MD5</option>
-												<option value="RSA" @if($alipay_sign_type == 'RSA') selected @endif>RSA</option>
+											<select class="col-md-5" id="alipay_sign_type" data-plugin="selectpicker" data-style="btn-outline btn-primary" onchange="updateFromOther('select','alipay_sign_type')">
+												<option value="MD5">MD5</option>
+												<option value="RSA">RSA</option>
 											</select>
 										</div>
 									</div>
 									<div class="form-group col-lg-6">
 										<div class="row">
 											<label class="col-md-3 col-form-label" for="alipay_transport">启用SSL验证</label>
-											<select class="col-md-5" name="alipay_transport" id="alipay_transport" data-plugin="selectpicker" data-style="btn-outline btn-primary" onchange="updateFromOther('select','alipay_transport')">
-												<option value="http" @if($alipay_transport == 'http') selected @endif>否</option>
-												<option value="https" @if($alipay_transport == 'https') selected @endif>是</option>
+											<select class="col-md-5" id="alipay_transport" data-plugin="selectpicker" data-style="btn-outline btn-primary" onchange="updateFromOther('select','alipay_transport')">
+												<option value="http">否</option>
+												<option value="https">是</option>
 											</select>
 											<span class="text-help offset-md-3"> HTTPS站点需启用 </span>
 										</div>
@@ -966,7 +998,7 @@
 											<label class="col-md-3 col-form-label" for="alipay_partner">Partner</label>
 											<div class="col-md-7">
 												<div class="input-group">
-													<input type="text" class="form-control" name="alipay_partner" id="alipay_partner" value="{{$alipay_partner}}"/>
+													<input type="text" class="form-control" id="alipay_partner" value="{{$alipay_partner}}"/>
 													<span class="input-group-append"><button class="btn btn-primary" type="button" onclick="update('alipay_partner')">修改</button></span>
 												</div>
 											</div>
@@ -977,7 +1009,7 @@
 											<label for="alipay_key" class="col-md-3 col-form-label">Key</label>
 											<div class="col-md-7">
 												<div class="input-group">
-													<input type="password" class="form-control" name="alipay_key" id="alipay_key" value="{{$alipay_key}}"/>
+													<input type="password" class="form-control" id="alipay_key" value="{{$alipay_key}}"/>
 													<span class="input-group-append"><button class="btn btn-primary" type="button" onclick="update('alipay_key')">修改</button></span>
 												</div>
 											</div>
@@ -988,7 +1020,7 @@
 											<label class="col-md-3 col-form-label" for="alipay_private_key">RSA私钥</label>
 											<div class="col-md-7">
 												<div class="input-group">
-													<input type="password" class="form-control" name="alipay_private_key" id="alipay_private_key" value="{{$alipay_private_key}}"/>
+													<input type="password" class="form-control" id="alipay_private_key" value="{{$alipay_private_key}}"/>
 													<span class="input-group-append"><button class="btn btn-primary" type="button" onclick="update('alipay_private_key')">修改</button></span>
 												</div>
 											</div>
@@ -999,7 +1031,7 @@
 											<label class="col-md-3 col-form-label" for="alipay_public_key">RSA公钥</label>
 											<div class="col-md-7">
 												<div class="input-group">
-													<input type="password" class="form-control" name="alipay_public_key" id="alipay_public_key" value="{{$alipay_public_key}}"/>
+													<input type="password" class="form-control" id="alipay_public_key" value="{{$alipay_public_key}}"/>
 													<span class="input-group-append"><button class="btn btn-primary" type="button" onclick="update('alipay_public_key')">修改</button></span>
 												</div>
 											</div>
@@ -1019,7 +1051,7 @@
 											<label class="col-md-3 col-form-label" for="f2fpay_app_id">应用ID</label>
 											<div class="col-md-7">
 												<div class="input-group">
-													<input type="text" class="form-control" name="f2fpay_app_id" id="f2fpay_app_id" value="{{$f2fpay_app_id}}"/>
+													<input type="text" class="form-control" id="f2fpay_app_id" value="{{$f2fpay_app_id}}"/>
 													<span class="input-group-append"><button class="btn btn-primary" type="button" onclick="update('f2fpay_app_id')">修改</button></span>
 												</div>
 											</div>
@@ -1031,7 +1063,7 @@
 											<label class="col-md-3 col-form-label" for="f2fpay_private_key">RSA私钥</label>
 											<div class="col-md-7">
 												<div class="input-group">
-													<input class="form-control" type="text" name="f2fpay_private_key" id="f2fpay_private_key" value="{{$f2fpay_private_key}}"/>
+													<input class="form-control" type="text" id="f2fpay_private_key" value="{{$f2fpay_private_key}}"/>
 													<span class="input-group-append"><button class="btn btn-primary" type="button" onclick="update('f2fpay_private_key')">修改</button></span>
 												</div>
 											</div>
@@ -1043,7 +1075,7 @@
 											<label class="col-md-3 col-form-label" for="f2fpay_public_key">支付宝公钥</label>
 											<div class="col-md-7">
 												<div class="input-group">
-													<input type="text" class="form-control" name="f2fpay_public_key" id="f2fpay_public_key" value="{{$f2fpay_public_key}}"/>
+													<input type="text" class="form-control" id="f2fpay_public_key" value="{{$f2fpay_public_key}}"/>
 													<span class="input-group-append"><button class="btn btn-primary" type="button" onclick="update('f2fpay_public_key')">修改</button></span>
 												</div>
 											</div>
@@ -1056,7 +1088,7 @@
 										<label class="col-md-3 col-form-label" for="f2fpay_subject_name">自定义商品名称</label>
 										<div class="col-md-7">
 											<div class="input-group">
-												<input type="text" class="form-control" name="f2fpay_subject_name" id="f2fpay_subject_name" value="{{$f2fpay_subject_name}}"/>
+												<input type="text" class="form-control" id="f2fpay_subject_name" value="{{$f2fpay_subject_name}}"/>
 												<span class="input-group-append"><button class="btn btn-primary" type="button" onclick="update('f2fpay_subject_name')">修改</button></span>
 											</div>
 										</div>
@@ -1083,15 +1115,26 @@
 	<script src="/assets/custom/jump-tab.js" type="text/javascript"></script>
 	<script src="/assets/global/js/Plugin/dropify.js" type="text/javascript"></script>
 
-	<!--suppress JSUnusedGlobalSymbols -->
 	<script type="text/javascript">
+        $(document).ready(function () {
+            $('#is_invite_register').selectpicker('val', {{$is_invite_register}});
+            $('#is_activate_account').selectpicker('val', {{$is_activate_account}});
+            $('#is_captcha').selectpicker('val', {{$is_captcha}});
+            $('#is_email_filtering').selectpicker('val', {{$is_email_filtering}});
+            $('#initial_labels_for_user').selectpicker('val', [{{$initial_labels_for_user}}]);
+            $('#is_notification').selectpicker('val', {{$is_notification}});
+            $('#alipay_currency').selectpicker('val', {{$alipay_currency}});
+            $('#alipay_sign_type').selectpicker('val', {{$alipay_sign_type}});
+            $('#alipay_transport').selectpicker('val', {{$alipay_transport}});
+        });
+
         // 系统设置更新
         function systemUpdate(systemItem, value) {
             $.post("/admin/setConfig", {_token: '{{csrf_token()}}', name: systemItem, value: value}, function (ret) {
                 if (ret.status === 'success') {
-                    swal.fire({title: ret.message, type: 'success', timer: 800, showConfirmButton: false});
+                    swal.fire({title: ret.message, type: 'success', timer: 1500, showConfirmButton: false});
                 } else {
-                    swal.fire({title: ret.message, type: "error"}).then(() => window.location.reload());
+                    swal.fire({title: ret.message, type: 'error'}).then(() => window.location.reload());
                 }
             });
         }
@@ -1105,9 +1148,9 @@
         function updateFromInput(systemItem, lowerBound, upperBound) {
             let value = parseInt($('#' + systemItem).val());
             if (lowerBound !== false && value < lowerBound) {
-                swal.fire({title: '不能小于' + lowerBound, type: 'warning', timer: 1000, showConfirmButton: false});
+                swal.fire({title: '不能小于' + lowerBound, type: 'warning', timer: 1500, showConfirmButton: false});
             } else if (upperBound !== false && value > upperBound) {
-                swal.fire({title: '不能大于' + upperBound, type: 'warning', timer: 1000, showConfirmButton: false});
+                swal.fire({title: '不能大于' + upperBound, type: 'warning', timer: 1500, showConfirmButton: false});
             } else {
                 systemUpdate(systemItem, value);
             }
@@ -1135,6 +1178,17 @@
             }
         }
 
+        // 发送Bark测试消息
+        function sendTestNotification() {
+            $.post("/admin/sendTestNotification", {_token: '{{csrf_token()}}'}, function (ret) {
+                if (ret.status === 'success') {
+                    swal.fire({title: ret.message, type: 'success', timer: 1500, showConfirmButton: false});
+                } else {
+                    swal.fire({title: ret.message, type: 'error'});
+                }
+            });
+        }
+
         // 自动去除公钥和私钥中的空格和换行
         $("#alipay_public_key,#alipay_private_key,#f2fpay_public_key,#f2fpay_private_key").on('input', function () {
             $(this).val($(this).val().replace(/(\s+)/g, ''));

+ 3 - 3
resources/views/auth/activeUser.blade.php

@@ -14,7 +14,7 @@
 		</div>
 	@endif
 	<form action="/activeUser" method="post">
-		@if(\App\Components\Helpers::systemConfig()['is_active_register'])
+		@if(\App\Components\Helpers::systemConfig()['is_activate_account'] == 2)
 			<div class="form-title">
 				<span class="form-title">{{trans('auth.active_account')}}</span>
 			</div>
@@ -28,8 +28,8 @@
 				<span> {{trans('auth.system_maintenance_tip',['email' => \App\Components\Helpers::systemConfig()['webmaster_email']])}}</span>
 			</div>
 		@endif
-		<a href="/login" class="btn btn-danger btn-lg {{\App\Components\Helpers::systemConfig()['is_active_register']? 'float-left':'btn-block'}}">{{trans('auth.back')}}</a>
-		@if(\App\Components\Helpers::systemConfig()['is_active_register'])
+		<a href="/login" class="btn btn-danger btn-lg {{\App\Components\Helpers::systemConfig()['is_activate_account']==2? 'float-left':'btn-block'}}">{{trans('auth.back')}}</a>
+		@if(\App\Components\Helpers::systemConfig()['is_activate_account']==2)
 			<button type="submit" class="btn btn-lg btn-primary float-right">{{trans('auth.active')}}</button>
 		@endif
 	</form>

+ 20 - 20
resources/views/auth/register.blade.php

@@ -20,10 +20,7 @@
 				<label class="floating-label" for="username">{{trans('auth.username')}}</label>
 			</div>
 			<div class="form-group form-material floating" data-plugin="formMaterial">
-				@if(\App\Components\Helpers::systemConfig()['sensitiveType'])
-					<input type="email" class="form-control" autocomplete="off" name="email" value="{{Request::old('email')}}" id="email" required/>
-					<label class="floating-label" for="email">{{trans('auth.email')}}</label>
-				@else
+				@if($emailList)
 					<div class="input-group">
 						<input type="text" class="form-control" autocomplete="off" name="emailHead" value="{{Request::old('emailHead')}}" id="emailHead" required/>
 						<label class="floating-label" for="emailHead">{{trans('auth.email')}}</label>
@@ -31,17 +28,18 @@
 							<span class="input-group-text bg-indigo-600 text-white">@</span>
 						</div>
 						<select class="form-control" name="emailTail" id="emailTail" data-plugin="selectpicker" data-style="btn-outline-primary">
-							@if(!$emailList->isEmpty())
-								@foreach($emailList as $email)
-									<option value="{{$email->words}}">{{$email->words}}</option>
-								@endforeach
-							@endif
+							@foreach($emailList as $email)
+								<option value="{{$email->words}}">{{$email->words}}</option>
+							@endforeach
 						</select>
 						<input type="text" name="email" id="email" hidden/>
 					</div>
+				@else
+					<input type="email" class="form-control" autocomplete="off" name="email" value="{{Request::old('email')}}" id="email" required/>
+					<label class="floating-label" for="email">{{trans('auth.email')}}</label>
 				@endif
 			</div>
-			@if(\App\Components\Helpers::systemConfig()['is_verify_register'])
+			@if(\App\Components\Helpers::systemConfig()['is_activate_account'] == 1)
 				<div class="form-group form-material floating" data-plugin="formMaterial">
 					<div class="input-group" data-plugin="inputGroupFile">
 						<input type="text" class="form-control" name="verify_code" value="{{Request::old('verify_code')}}" required/>
@@ -163,27 +161,29 @@
 	<script src="/assets/global/vendor/bootstrap-select/bootstrap-select.min.js" type="text/javascript"></script>
 	<script src="/assets/global/js/Plugin/bootstrap-select.js" type="text/javascript"></script>
 	<script type="text/javascript">
-		@if(!\App\Components\Helpers::systemConfig()['sensitiveType'])
+		@if($emailList)
         function getEmail() {
-            let email = $("#emailHead").val();
+            let email = $("#emailHead").val().trim();
             const emailTail = $("#emailTail").val();
-            if (email.trim() === '') {
+            if (email === '') {
                 swal.fire({title: '{{trans('auth.email_null')}}', type: 'warning', timer: 1500});
                 return false;
             }
-            email = email.trim() + '@' + emailTail;
+            email += '@' + emailTail;
             $("#email").val(email);
+            return email;
         }
 		@endif
 
         // 发送注册验证码
         function sendVerifyCode() {
             let flag = true; // 请求成功与否标记
-			@if(!\App\Components\Helpers::systemConfig()['sensitiveType'])
-            getEmail();
-					@endif
-            const email = $("#email").val();
-            if (email.trim() === '') {
+            let email = $("#email").val().trim();
+			@if($emailList)
+                email = getEmail();
+			@endif
+
+            if (email === '') {
                 swal.fire({title: '{{trans('auth.email_null')}}', type: 'warning', timer: 1500});
                 return false;
             }
@@ -228,7 +228,7 @@
         }
 
         $('#register-form').submit(function (event) {
-			@if(!\App\Components\Helpers::systemConfig()['sensitiveType'])
+			@if($emailList)
             getEmail();
 			@endif
             // 先检查Google reCAPTCHA有没有进行验证

+ 1 - 1
resources/views/emails/activeUser.blade.php

@@ -77,7 +77,7 @@
 									<th class="expander" style="Margin:0;color:#333;font-family:Helvetica,Arial,sans-serif;font-size:16px;font-weight:400;line-height:19px;margin:0;padding:0!important;text-align:left;visibility:hidden;width:0"></th>
 								</tr>
 								</tbody>
-								</th></tr></tbody>
+								</th></tbody>
 							</table>
 						</td>
 					</tr>

+ 1 - 1
resources/views/emails/closeTicket.blade.php

@@ -74,7 +74,7 @@
 									<th class="expander" style="Margin:0;color:#333;font-family:Helvetica,Arial,sans-serif;font-size:16px;font-weight:400;line-height:19px;margin:0;padding:0!important;text-align:left;visibility:hidden;width:0"></th>
 								</tr>
 								</tbody>
-								</th></tr></tbody>
+								</th></tbody>
 							</table>
 						</td>
 					</tr>

+ 1 - 1
resources/views/emails/newTicket.blade.php

@@ -74,7 +74,7 @@
 									<th class="expander" style="Margin:0;color:#333;font-family:Helvetica,Arial,sans-serif;font-size:16px;font-weight:400;line-height:19px;margin:0;padding:0!important;text-align:left;visibility:hidden;width:0"></th>
 								</tr>
 								</tbody>
-								</th></tr></tbody>
+								</th></tbody>
 							</table>
 						</td>
 					</tr>

+ 2 - 2
resources/views/emails/nodeCrashWarning.blade.php

@@ -2,7 +2,7 @@
 	<tbody>
 	<tr style="padding:0;text-align:left;vertical-align:top">
 		<td class="center" align="center" valign="top" style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#333;font-family:Helvetica,Arial,sans-serif;font-size:16px;font-weight:400;hyphens:auto;line-height:19px;margin:0;padding:0;text-align:left;vertical-align:top;word-wrap:break-word">
-			<center data-parsed="" style="min-width:580px;width:100%">
+			<div data-parsed="" style="min-width:580px;width:100%; text-align: center;">
 				<table align="center" class="container no-bg float-center" style="Margin:0 auto;background:0 0;border:0;border-collapse:collapse;border-radius:3px;border-spacing:0;box-shadow:none;float:none;margin:0 auto;margin-top:20px;padding:0;text-align:center;vertical-align:top;width:580px">
 					<tbody>
 					<tr style="padding:0;text-align:left;vertical-align:top">
@@ -80,7 +80,7 @@
 					</tr>
 					</tbody>
 				</table>
-			</center>
+			</div>
 		</td>
 	</tr>
 	</tbody>

+ 1 - 1
resources/views/emails/replyTicket.blade.php

@@ -74,7 +74,7 @@
 									<th class="expander" style="Margin:0;color:#333;font-family:Helvetica,Arial,sans-serif;font-size:16px;font-weight:400;line-height:19px;margin:0;padding:0!important;text-align:left;visibility:hidden;width:0"></th>
 								</tr>
 								</tbody>
-								</th></tr></tbody>
+								</th></tbody>
 							</table>
 						</td>
 					</tr>

+ 1 - 1
resources/views/emails/sendUserInfo.blade.php

@@ -121,7 +121,7 @@
 									<th class="expander" style="Margin:0;color:#333;font-family:Helvetica,Arial,sans-serif;font-size:16px;font-weight:400;line-height:19px;margin:0;padding:0!important;text-align:left;visibility:hidden;width:0"></th>
 								</tr>
 								</tbody>
-								</th></tr></tbody>
+								</th></tbody>
 							</table>
 						</td>
 					</tr>

+ 1 - 1
resources/views/emails/sendVerifyCode.blade.php

@@ -74,7 +74,7 @@
 									<th class="expander" style="Margin:0;color:#333;font-family:Helvetica,Arial,sans-serif;font-size:16px;font-weight:400;line-height:19px;margin:0;padding:0!important;text-align:left;visibility:hidden;width:0"></th>
 								</tr>
 								</tbody>
-								</th></tr></tbody>
+								</th></tbody>
 							</table>
 						</td>
 					</tr>

+ 1 - 1
resources/views/emails/userExpireWarning.blade.php

@@ -74,7 +74,7 @@
 									<th class="expander" style="Margin:0;color:#333;font-family:Helvetica,Arial,sans-serif;font-size:16px;font-weight:400;line-height:19px;margin:0;padding:0!important;text-align:left;visibility:hidden;width:0"></th>
 								</tr>
 								</tbody>
-								</th></tr></tbody>
+								</th></tbody>
 							</table>
 						</td>
 					</tr>

+ 1 - 1
resources/views/emails/userExpireWarningToday.blade.php

@@ -74,7 +74,7 @@
 									<th class="expander" style="Margin:0;color:#333;font-family:Helvetica,Arial,sans-serif;font-size:16px;font-weight:400;line-height:19px;margin:0;padding:0!important;text-align:left;visibility:hidden;width:0"></th>
 								</tr>
 								</tbody>
-								</th></tr></tbody>
+								</th></tbody>
 							</table>
 						</td>
 					</tr>

+ 1 - 1
resources/views/emails/userTrafficWarning.blade.php

@@ -74,7 +74,7 @@
 									<th class="expander" style="Margin:0;color:#333;font-family:Helvetica,Arial,sans-serif;font-size:16px;font-weight:400;line-height:19px;margin:0;padding:0!important;text-align:left;visibility:hidden;width:0"></th>
 								</tr>
 								</tbody>
-								</th></tr></tbody>
+								</th></tbody>
 							</table>
 						</td>
 					</tr>

+ 4 - 4
resources/views/user/layouts.blade.php

@@ -274,10 +274,10 @@
 	<script type="text/javascript">
         $("#return_to_admin").click(function () {
             $.ajax({
-                'type': "POST",
-                'url': "/switchToAdmin",
-                'data': {'_token': '{{csrf_token()}}'},
-                'dataType': "json",
+                type: "POST",
+                url: "/switchToAdmin",
+                data: {'_token': '{{csrf_token()}}'},
+                dataType: "json",
                 success: function (ret) {
                     swal.fire({
                         title: ret.message,

+ 0 - 1
resources/views/user/services.blade.php

@@ -224,7 +224,6 @@
             const charge_coupon = $('#charge_coupon').val().trim();
             const amount = parseInt($('#amount').val());
             id = parseInt(id);
-            console.log(paymentType, charge_coupon, amount);
             if (paymentType === 1) {
                 if (amount <= 0) {
                     swal.fire({title: "错误", text: "充值余额不合规", type: 'warning', timer: 1000, showConfirmButton: false});

+ 2 - 1
routes/web.php

@@ -102,11 +102,12 @@ Route::group(['middleware' => ['isForbidden','isAdminLogin', 'isAdmin']], functi
 	Route::any('admin/import', 'AdminController@import'); // 数据导入
 	Route::get('admin/trafficLog', 'AdminController@trafficLog'); // 流量日志
 	Route::get('admin/analysis', 'AdminController@analysis'); // 日志分析
-	Route::get('admin/emailLog', 'AdminController@emailLog'); // 邮件发送日志
+	Route::get('admin/notificationLog', 'AdminController@notificationLog'); // 邮件发送日志
 	Route::get("payment/callbackList", "PaymentController@callbackList"); // 支付回调日志
 	Route::get("sensitiveWords/list", "SensitiveWordsController@sensitiveWordslist"); // 敏感词列表
 	Route::post("sensitiveWords/add", "SensitiveWordsController@addSensitiveWords"); // 添加敏感词
 	Route::post("sensitiveWords/del", "SensitiveWordsController@delSensitiveWords"); // 删除敏感词
+	Route::post('admin/sendTestNotification', 'AdminController@sendTestNotification'); //推送通知测试
 	Route::get('logs', '\Rap2hpoutre\LaravelLogViewer\LogViewerController@index'); // 系统运行日志
 	Route::any('admin/profile', 'AdminController@profile'); // 修改个人信息
 	Route::get('admin/makePort', 'AdminController@makePort'); // 生成端口

+ 11 - 10
sql/db.sql

@@ -331,9 +331,9 @@ INSERT INTO `config` VALUES ('33', 'is_traffic_ban', 1);
 INSERT INTO `config` VALUES ('34', 'traffic_ban_value', 10);
 INSERT INTO `config` VALUES ('35', 'traffic_ban_time', 60);
 INSERT INTO `config` VALUES ('36', 'is_clear_log', 1);
-INSERT INTO `config` VALUES ('37', 'is_node_crash_warning', 0);
+INSERT INTO `config` VALUES ('37', 'is_node_offline', 0);
 INSERT INTO `config` VALUES ('38', 'webmaster_email', '');
-INSERT INTO `config` VALUES ('39', 'is_server_chan', 0);
+INSERT INTO `config` VALUES ('39', 'is_notification', 0);
 INSERT INTO `config` VALUES ('40', 'server_chan_key', '');
 INSERT INTO `config` VALUES ('41', 'is_subscribe_ban', 1);
 INSERT INTO `config` VALUES ('42', 'subscribe_ban_times', 20);
@@ -352,7 +352,7 @@ INSERT INTO `config` VALUES ('54', 'initial_labels_for_user', '');
 INSERT INTO `config` VALUES ('55', 'website_analytics', '');
 INSERT INTO `config` VALUES ('56', 'website_customer_service', '');
 INSERT INTO `config` VALUES ('57', 'register_ip_limit', 5);
-INSERT INTO `config` VALUES ('58', 'sensitiveType', '1');
+INSERT INTO `config` VALUES ('58', 'is_email_filtering', '0');
 INSERT INTO `config` VALUES ('59', 'is_push_bear', 0);
 INSERT INTO `config` VALUES ('60', 'push_bear_send_key', '');
 INSERT INTO `config` VALUES ('61', 'push_bear_qrcode', '');
@@ -362,12 +362,12 @@ INSERT INTO `config` VALUES ('64', 'namesilo_key', '');
 INSERT INTO `config` VALUES ('65', 'website_logo', '');
 INSERT INTO `config` VALUES ('66', 'website_home_logo', '');
 INSERT INTO `config` VALUES ('67', 'nodes_detection', 0);
-INSERT INTO `config` VALUES ('68', 'numberOfWarningTimes', 3);
+INSERT INTO `config` VALUES ('68', 'detection_check_times', 3);
 INSERT INTO `config` VALUES ('69', 'is_forbid_china', 0);
 INSERT INTO `config` VALUES ('70', 'is_forbid_oversea', 0);
 INSERT INTO `config` VALUES ('71', 'AppStore_id', 0);
 INSERT INTO `config` VALUES ('72', 'AppStore_password', 0);
-INSERT INTO `config` VALUES ('73', 'is_verify_register', 0);
+INSERT INTO `config` VALUES ('73', 'is_activate_account', 0);
 INSERT INTO `config` VALUES ('74', 'node_daily_report', 0);
 INSERT INTO `config` VALUES ('75', 'mix_subscribe', 0);
 INSERT INTO `config` VALUES ('76', 'rand_subscribe', 0);
@@ -392,12 +392,13 @@ INSERT INTO `config` VALUES ('94', 'google_captcha_sitekey', '');
 INSERT INTO `config` VALUES ('95', 'google_captcha_secret', '');
 INSERT INTO `config` VALUES ('96', 'user_invite_days', 7);
 INSERT INTO `config` VALUES ('97', 'admin_invite_days', 7);
-INSERT INTO `config` VALUES ('98', 'admin_email', '');
+INSERT INTO `config` VALUES ('98', 'offline_check_times', '');
 INSERT INTO `config` VALUES ('99', 'payjs_mch_id', '');
 INSERT INTO `config` VALUES ('100', 'payjs_key', '');
 insert into `config` VALUES ('101', 'maintenance_mode', '0');
 insert into `config` VALUES ('102', 'maintenance_time', '');
 insert into `config` VALUES ('103', 'maintenance_content', '');
+insert into `config` VALUES ('104', 'bark_key', '');
 
 -- ----------------------------
 -- Table structure for `article`
@@ -723,11 +724,11 @@ CREATE TABLE `referral_log` (
 
 
 -- ----------------------------
--- Table structure for `email_log`
+-- Table structure for `notification_log`
 -- ----------------------------
-CREATE TABLE `email_log` (
+CREATE TABLE `notification_log` (
   `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
-  `type` TINYINT(4) NOT NULL DEFAULT '1' COMMENT '类型:1-邮件、2-serverChan',
+  `type` TINYINT(4) NOT NULL DEFAULT '1' COMMENT '类型:1-邮件、2-serverChan、3-Bark',
   `address` VARCHAR(255) NOT NULL COMMENT '收信地址',
   `title` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '标题',
   `content` TEXT NOT NULL COMMENT '内容',
@@ -736,7 +737,7 @@ CREATE TABLE `email_log` (
   `created_at` datetime DEFAULT NULL COMMENT '创建时间',
   `updated_at` datetime DEFAULT NULL COMMENT '最后更新时间',
   PRIMARY KEY (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='邮件投递记录';
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='通知投递记录';
 
 
 -- ----------------------------

+ 12 - 0
sql/mod/20200412.sql

@@ -0,0 +1,12 @@
+rename table `email_log` to `notification_log`;
+alter table `notification_log` COMMENT = '通知投递记录';
+alter table `notification_log` CHANGE `type` `type` TINYINT(4) NOT NULL DEFAULT '1' COMMENT '类型:1-邮件、2-ServerChan、3-Bark';
+-- 加入Bark通知
+insert into `config` VALUES ('104', 'bark_key', '');
+
+update `config` SET `name` = 'is_node_offline' where `config`.`id` = 37;
+update `config` SET `name` = 'is_notification', `value` = '0'  where `config`.`id` = 39;
+update `config` SET `name` = 'is_email_filtering',`value` = '0' where `config`.`id` = 58;
+update `config` SET `name` = 'detection_check_times' where `config`.`id` = 68;
+update `config` SET `name` = 'is_activate_account', `value` = '0' where `config`.`id` = 73;
+update `config` SET `name` = 'offline_check_times', `value` = '10' where `config`.`id` = 98;