diff --git a/app/Components/Callback.php b/app/Components/Callback.php index c6933228..59b1c4cb 100644 --- a/app/Components/Callback.php +++ b/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(); diff --git a/app/Components/Helpers.php b/app/Components/Helpers.php index 2544aff6..44ab9a22 100644 --- a/app/Components/Helpers.php +++ b/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; diff --git a/app/Components/Namesilo.php b/app/Components/Namesilo.php index ca2ecf86..83b59d37 100644 --- a/app/Components/Namesilo.php +++ b/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; } diff --git a/app/Components/PushNotification.php b/app/Components/PushNotification.php new file mode 100644 index 00000000..c026f4c1 --- /dev/null +++ b/app/Components/PushNotification.php @@ -0,0 +1,83 @@ +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; + } +} \ No newline at end of file diff --git a/app/Components/ServerChan.php b/app/Components/ServerChan.php deleted file mode 100644 index bd9d40b6..00000000 --- a/app/Components/ServerChan.php +++ /dev/null @@ -1,64 +0,0 @@ -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(); - } -} \ No newline at end of file diff --git a/app/Console/Commands/AutoJob.php b/app/Console/Commands/AutoJob.php index 9eebc33f..6c7fa5ad 100644 --- a/app/Console/Commands/AutoJob.php +++ b/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}】**异常:**心跳异常,可能离线了**"); + } + } } } } diff --git a/app/Console/Commands/AutoReportNode.php b/app/Console/Commands/AutoReportNode.php index 871b66af..b6af726f 100644 --- a/app/Console/Commands/AutoReportNode.php +++ b/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); } } diff --git a/app/Console/Commands/DailyJob.php b/app/Console/Commands/DailyJob.php index c7297d89..eda83fff 100644 --- a/app/Console/Commands/DailyJob.php +++ b/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? : '【无】')); } } } \ No newline at end of file diff --git a/app/Console/Commands/NodeBlockedDetection.php b/app/Console/Commands/NodeBlockedDetection.php index d13c7dad..c6db1afb 100644 --- a/app/Console/Commands/NodeBlockedDetection.php +++ b/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); } } diff --git a/app/Console/Commands/UserExpireAutoWarning.php b/app/Console/Commands/UserExpireAutoWarning.php index 05336eb5..49cba8e1 100644 --- a/app/Console/Commands/UserExpireAutoWarning.php +++ b/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)); } } diff --git a/app/Console/Commands/UserTrafficAbnormalAutoWarning.php b/app/Console/Commands/UserTrafficAbnormalAutoWarning.php index 7ba37b34..649eece6 100644 --- a/app/Console/Commands/UserTrafficAbnormalAutoWarning.php +++ b/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); } } } diff --git a/app/Console/Commands/UserTrafficAutoWarning.php b/app/Console/Commands/UserTrafficAutoWarning.php index f228bd8c..be059cc8 100644 --- a/app/Console/Commands/UserTrafficAutoWarning.php +++ b/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)); } } diff --git a/app/Http/Controllers/AdminController.php b/app/Http/Controllers/AdminController.php index 972b1461..fc3b001c 100644 --- a/app/Http/Controllers/AdminController.php +++ b/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监控(实时) diff --git a/app/Http/Controllers/AuthController.php b/app/Http/Controllers/AuthController.php index 838c6a82..3dbcacbb 100644 --- a/app/Http/Controllers/AuthController.php +++ b/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').'【'.trans('auth.active_account').'】'); @@ -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')]); } // 生成注册验证码 diff --git a/app/Http/Controllers/TicketController.php b/app/Http/Controllers/TicketController.php index 06da51ec..58b6f5ac 100644 --- a/app/Http/Controllers/TicketController.php +++ b/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' => '关闭成功']); diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 9643075e..dd32d65a 100644 --- a/app/Http/Controllers/UserController.php +++ b/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{ diff --git a/app/Http/Models/EmailLog.php b/app/Http/Models/EmailLog.php deleted file mode 100644 index a525eab2..00000000 --- a/app/Http/Models/EmailLog.php +++ /dev/null @@ -1,43 +0,0 @@ -where('id', $this->id)->update(['status' => -1, 'error' => $e->getMessage()]); + NotificationLog::query()->where('id', $this->id)->update(['status' => -1, 'error' => $e->getMessage()]); } } diff --git a/app/Mail/closeTicket.php b/app/Mail/closeTicket.php index d4959cb3..da59c213 100644 --- a/app/Mail/closeTicket.php +++ b/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()]); } } diff --git a/app/Mail/newTicket.php b/app/Mail/newTicket.php index e3d13566..d34d53b1 100644 --- a/app/Mail/newTicket.php +++ b/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()]); } } diff --git a/app/Mail/nodeCrashWarning.php b/app/Mail/nodeCrashWarning.php index 62b5eb22..3bffa80e 100644 --- a/app/Mail/nodeCrashWarning.php +++ b/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()]); } } diff --git a/app/Mail/replyTicket.php b/app/Mail/replyTicket.php index a6e1bf97..6356d90c 100644 --- a/app/Mail/replyTicket.php +++ b/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()]); } } diff --git a/app/Mail/resetPassword.php b/app/Mail/resetPassword.php index 90bfb9aa..b4989534 100644 --- a/app/Mail/resetPassword.php +++ b/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()]); } } diff --git a/app/Mail/sendUserInfo.php b/app/Mail/sendUserInfo.php index 9f901620..aab12bb9 100644 --- a/app/Mail/sendUserInfo.php +++ b/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()]); } } diff --git a/app/Mail/sendVerifyCode.php b/app/Mail/sendVerifyCode.php index 4da1a9da..b264e2f8 100644 --- a/app/Mail/sendVerifyCode.php +++ b/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()]); } } diff --git a/app/Mail/userExpireWarning.php b/app/Mail/userExpireWarning.php index 3b0c59ca..817b5411 100644 --- a/app/Mail/userExpireWarning.php +++ b/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()]); } } diff --git a/app/Mail/userExpireWarningToday.php b/app/Mail/userExpireWarningToday.php index e8fca647..1c8da3b3 100644 --- a/app/Mail/userExpireWarningToday.php +++ b/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()]); } } diff --git a/app/Mail/userTrafficWarning.php b/app/Mail/userTrafficWarning.php index 6fc1bbf7..d299176d 100644 --- a/app/Mail/userTrafficWarning.php +++ b/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()]); } } diff --git a/composer.lock b/composer.lock index 748f2411..4ebb8572 100644 --- a/composer.lock +++ b/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", diff --git a/resources/views/admin/layouts.blade.php b/resources/views/admin/layouts.blade.php index 2366d08d..ae510af9 100644 --- a/resources/views/admin/layouts.blade.php +++ b/resources/views/admin/layouts.blade.php @@ -253,7 +253,7 @@ -
| {{$vo->id}} | -{{$vo->type == 1 ? 'Email' : 'serverChan'}} | +{{$vo->type == 1 ? 'Email' : ($vo->type == 2? 'ServerChan': 'Bark')}} | @if($vo->type == 3) {{$vo->code}} @endif | {{$vo->address}} | @@ -92,7 +92,7 @@ @endsection diff --git a/resources/views/admin/system.blade.php b/resources/views/admin/system.blade.php index b7666fa4..8f9801f2 100644 --- a/resources/views/admin/system.blade.php +++ b/resources/views/admin/system.blade.php @@ -73,7 +73,7 @@