Просмотр исходного кода

1.修正错误
2.系统设置界面美化
3.引入agent识别访问设备组件

bingo 8 лет назад
Родитель
Сommit
b0e900afe3

+ 2 - 2
.env

@@ -1,9 +1,9 @@
 APP_NAME=Laravel
 APP_ENV=local
-APP_KEY=base64:+P29JuonB2Q8yy0ENL0k9GVS+S6twoGLTy3r+OT8ES4=
+APP_KEY=base64:6nNq+XYCwjwi/FQ/x9tK40ETErxtRUzLWk8Jny9bRa8=
 APP_DEBUG=true
 APP_LOG_LEVEL=debug
-APP_URL=http://localssrpanel.com
+APP_URL=http://localhost
 
 DB_CONNECTION=mysql
 DB_HOST=127.0.0.1

+ 586 - 38
_ide_helper.php

@@ -1,7 +1,7 @@
 <?php
 /**
  * A helper file for Laravel 5, to provide autocomplete information to your IDE
- * Generated for Laravel 5.4.30 on 2017-11-07.
+ * Generated for Laravel 5.4.30 on 2017-11-08.
  *
  * @author Barry vd. Heuvel <[email protected]>
  * @see https://github.com/barryvdh/laravel-ide-helper
@@ -1898,35 +1898,35 @@ namespace Illuminate\Support\Facades {
         /**
          * Determine if the current user is authenticated.
          *
-         * @return \App\User 
-         * @throws \Illuminate\Auth\AuthenticationException
+         * @return bool 
          * @static 
          */ 
-        public static function authenticate()
+        public static function check()
         {
-            return \Illuminate\Auth\SessionGuard::authenticate();
+            return \Illuminate\Auth\SessionGuard::check();
         }
         
         /**
-         * Determine if the current user is authenticated.
+         * Determine if the current user is a guest.
          *
          * @return bool 
          * @static 
          */ 
-        public static function check()
+        public static function guest()
         {
-            return \Illuminate\Auth\SessionGuard::check();
+            return \Illuminate\Auth\SessionGuard::guest();
         }
         
         /**
-         * Determine if the current user is a guest.
+         * Determine if the current user is authenticated.
          *
-         * @return bool 
+         * @return \App\User 
+         * @throws \Illuminate\Auth\AuthenticationException
          * @static 
          */ 
-        public static function guest()
+        public static function authenticate()
         {
-            return \Illuminate\Auth\SessionGuard::guest();
+            return \Illuminate\Auth\SessionGuard::authenticate();
         }
         
         /**
@@ -11153,6 +11153,32 @@ namespace Illuminate\Support\Facades {
             return \Illuminate\View\Factory::getShared();
         }
         
+        /**
+         * Register a view composer event.
+         *
+         * @param array|string $views
+         * @param \Closure|string $callback
+         * @return array 
+         * @static 
+         */ 
+        public static function composer($views, $callback)
+        {
+            return \Illuminate\View\Factory::composer($views, $callback);
+        }
+        
+        /**
+         * Register a view creator event.
+         *
+         * @param array|string $views
+         * @param \Closure|string $callback
+         * @return array 
+         * @static 
+         */ 
+        public static function creator($views, $callback)
+        {
+            return \Illuminate\View\Factory::creator($views, $callback);
+        }
+        
         /**
          * Start a component rendering process.
          *
@@ -11201,19 +11227,6 @@ namespace Illuminate\Support\Facades {
             \Illuminate\View\Factory::endSlot();
         }
         
-        /**
-         * Register a view creator event.
-         *
-         * @param array|string $views
-         * @param \Closure|string $callback
-         * @return array 
-         * @static 
-         */ 
-        public static function creator($views, $callback)
-        {
-            return \Illuminate\View\Factory::creator($views, $callback);
-        }
-        
         /**
          * Register multiple view composers via an array.
          *
@@ -11226,19 +11239,6 @@ namespace Illuminate\Support\Facades {
             return \Illuminate\View\Factory::composers($composers);
         }
         
-        /**
-         * Register a view composer event.
-         *
-         * @param array|string $views
-         * @param \Closure|string $callback
-         * @return array 
-         * @static 
-         */ 
-        public static function composer($views, $callback)
-        {
-            return \Illuminate\View\Factory::composer($views, $callback);
-        }
-        
         /**
          * Call the composer for a given view.
          *
@@ -11749,6 +11749,552 @@ namespace Mews\Captcha\Facades {
  
 }
 
+namespace Jenssegers\Agent\Facades { 
+
+    class Agent {
+        
+        /**
+         * Get all detection rules. These rules include the additional
+         * platforms and browsers.
+         *
+         * @return array 
+         * @static 
+         */ 
+        public static function getDetectionRulesExtended()
+        {
+            return \Jenssegers\Agent\Agent::getDetectionRulesExtended();
+        }
+        
+        /**
+         * 
+         *
+         * @inheritdoc 
+         * @static 
+         */ 
+        public static function getRules()
+        {
+            return \Jenssegers\Agent\Agent::getRules();
+        }
+        
+        /**
+         * 
+         *
+         * @return \Jenssegers\Agent\CrawlerDetect 
+         * @static 
+         */ 
+        public static function getCrawlerDetect()
+        {
+            return \Jenssegers\Agent\Agent::getCrawlerDetect();
+        }
+        
+        /**
+         * Get accept languages.
+         *
+         * @param string $acceptLanguage
+         * @return array 
+         * @static 
+         */ 
+        public static function languages($acceptLanguage = null)
+        {
+            return \Jenssegers\Agent\Agent::languages($acceptLanguage);
+        }
+        
+        /**
+         * Get the browser name.
+         *
+         * @param null $userAgent
+         * @return string 
+         * @static 
+         */ 
+        public static function browser($userAgent = null)
+        {
+            return \Jenssegers\Agent\Agent::browser($userAgent);
+        }
+        
+        /**
+         * Get the platform name.
+         *
+         * @param string $userAgent
+         * @return string 
+         * @static 
+         */ 
+        public static function platform($userAgent = null)
+        {
+            return \Jenssegers\Agent\Agent::platform($userAgent);
+        }
+        
+        /**
+         * Get the device name.
+         *
+         * @param string $userAgent
+         * @return string 
+         * @static 
+         */ 
+        public static function device($userAgent = null)
+        {
+            return \Jenssegers\Agent\Agent::device($userAgent);
+        }
+        
+        /**
+         * Check if the device is a desktop computer.
+         *
+         * @param string $userAgent deprecated
+         * @param array $httpHeaders deprecated
+         * @return bool 
+         * @static 
+         */ 
+        public static function isDesktop($userAgent = null, $httpHeaders = null)
+        {
+            return \Jenssegers\Agent\Agent::isDesktop($userAgent, $httpHeaders);
+        }
+        
+        /**
+         * Check if the device is a mobile phone.
+         *
+         * @param string $userAgent deprecated
+         * @param array $httpHeaders deprecated
+         * @return bool 
+         * @static 
+         */ 
+        public static function isPhone($userAgent = null, $httpHeaders = null)
+        {
+            return \Jenssegers\Agent\Agent::isPhone($userAgent, $httpHeaders);
+        }
+        
+        /**
+         * Get the robot name.
+         *
+         * @param string $userAgent
+         * @return string|bool 
+         * @static 
+         */ 
+        public static function robot($userAgent = null)
+        {
+            return \Jenssegers\Agent\Agent::robot($userAgent);
+        }
+        
+        /**
+         * Check if device is a robot.
+         *
+         * @param string $userAgent
+         * @return bool 
+         * @static 
+         */ 
+        public static function isRobot($userAgent = null)
+        {
+            return \Jenssegers\Agent\Agent::isRobot($userAgent);
+        }
+        
+        /**
+         * 
+         *
+         * @inheritdoc 
+         * @static 
+         */ 
+        public static function version($propertyName, $type = 'text')
+        {
+            return \Jenssegers\Agent\Agent::version($propertyName, $type);
+        }
+        
+        /**
+         * Get the current script version.
+         * 
+         * This is useful for the demo.php file,
+         * so people can check on what version they are testing
+         * for mobile devices.
+         *
+         * @return string The version number in semantic version format.
+         * @static 
+         */ 
+        public static function getScriptVersion()
+        {
+            //Method inherited from \Mobile_Detect            
+            return \Jenssegers\Agent\Agent::getScriptVersion();
+        }
+        
+        /**
+         * Set the HTTP Headers. Must be PHP-flavored. This method will reset existing headers.
+         *
+         * @param array $httpHeaders The headers to set. If null, then using PHP's _SERVER to extract
+         *                           the headers. The default null is left for backwards compatibility.
+         * @static 
+         */ 
+        public static function setHttpHeaders($httpHeaders = null)
+        {
+            //Method inherited from \Mobile_Detect            
+            return \Jenssegers\Agent\Agent::setHttpHeaders($httpHeaders);
+        }
+        
+        /**
+         * Retrieves the HTTP headers.
+         *
+         * @return array 
+         * @static 
+         */ 
+        public static function getHttpHeaders()
+        {
+            //Method inherited from \Mobile_Detect            
+            return \Jenssegers\Agent\Agent::getHttpHeaders();
+        }
+        
+        /**
+         * Retrieves a particular header. If it doesn't exist, no exception/error is caused.
+         * 
+         * Simply null is returned.
+         *
+         * @param string $header The name of the header to retrieve. Can be HTTP compliant such as
+         *                       "User-Agent" or "X-Device-User-Agent" or can be php-esque with the
+         *                       all-caps, HTTP_ prefixed, underscore seperated awesomeness.
+         * @return string|null The value of the header.
+         * @static 
+         */ 
+        public static function getHttpHeader($header)
+        {
+            //Method inherited from \Mobile_Detect            
+            return \Jenssegers\Agent\Agent::getHttpHeader($header);
+        }
+        
+        /**
+         * 
+         *
+         * @static 
+         */ 
+        public static function getMobileHeaders()
+        {
+            //Method inherited from \Mobile_Detect            
+            return \Jenssegers\Agent\Agent::getMobileHeaders();
+        }
+        
+        /**
+         * Get all possible HTTP headers that
+         * can contain the User-Agent string.
+         *
+         * @return array List of HTTP headers.
+         * @static 
+         */ 
+        public static function getUaHttpHeaders()
+        {
+            //Method inherited from \Mobile_Detect            
+            return \Jenssegers\Agent\Agent::getUaHttpHeaders();
+        }
+        
+        /**
+         * Set CloudFront headers
+         * http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/header-caching.html#header-caching-web-device
+         *
+         * @param array $cfHeaders List of HTTP headers
+         * @return boolean If there were CloudFront headers to be set
+         * @static 
+         */ 
+        public static function setCfHeaders($cfHeaders = null)
+        {
+            //Method inherited from \Mobile_Detect            
+            return \Jenssegers\Agent\Agent::setCfHeaders($cfHeaders);
+        }
+        
+        /**
+         * Retrieves the cloudfront headers.
+         *
+         * @return array 
+         * @static 
+         */ 
+        public static function getCfHeaders()
+        {
+            //Method inherited from \Mobile_Detect            
+            return \Jenssegers\Agent\Agent::getCfHeaders();
+        }
+        
+        /**
+         * Set the User-Agent to be used.
+         *
+         * @param string $userAgent The user agent string to set.
+         * @return string|null 
+         * @static 
+         */ 
+        public static function setUserAgent($userAgent = null)
+        {
+            //Method inherited from \Mobile_Detect            
+            return \Jenssegers\Agent\Agent::setUserAgent($userAgent);
+        }
+        
+        /**
+         * Retrieve the User-Agent.
+         *
+         * @return string|null The user agent if it's set.
+         * @static 
+         */ 
+        public static function getUserAgent()
+        {
+            //Method inherited from \Mobile_Detect            
+            return \Jenssegers\Agent\Agent::getUserAgent();
+        }
+        
+        /**
+         * Set the detection type. Must be one of self::DETECTION_TYPE_MOBILE or
+         * self::DETECTION_TYPE_EXTENDED. Otherwise, nothing is set.
+         *
+         * @deprecated since version 2.6.9
+         * @param string $type The type. Must be a self::DETECTION_TYPE_* constant. The default
+         *                     parameter is null which will default to self::DETECTION_TYPE_MOBILE.
+         * @static 
+         */ 
+        public static function setDetectionType($type = null)
+        {
+            //Method inherited from \Mobile_Detect            
+            return \Jenssegers\Agent\Agent::setDetectionType($type);
+        }
+        
+        /**
+         * 
+         *
+         * @static 
+         */ 
+        public static function getMatchingRegex()
+        {
+            //Method inherited from \Mobile_Detect            
+            return \Jenssegers\Agent\Agent::getMatchingRegex();
+        }
+        
+        /**
+         * 
+         *
+         * @static 
+         */ 
+        public static function getMatchesArray()
+        {
+            //Method inherited from \Mobile_Detect            
+            return \Jenssegers\Agent\Agent::getMatchesArray();
+        }
+        
+        /**
+         * Retrieve the list of known phone devices.
+         *
+         * @return array List of phone devices.
+         * @static 
+         */ 
+        public static function getPhoneDevices()
+        {
+            //Method inherited from \Mobile_Detect            
+            return \Jenssegers\Agent\Agent::getPhoneDevices();
+        }
+        
+        /**
+         * Retrieve the list of known tablet devices.
+         *
+         * @return array List of tablet devices.
+         * @static 
+         */ 
+        public static function getTabletDevices()
+        {
+            //Method inherited from \Mobile_Detect            
+            return \Jenssegers\Agent\Agent::getTabletDevices();
+        }
+        
+        /**
+         * Alias for getBrowsers() method.
+         *
+         * @return array List of user agents.
+         * @static 
+         */ 
+        public static function getUserAgents()
+        {
+            //Method inherited from \Mobile_Detect            
+            return \Jenssegers\Agent\Agent::getUserAgents();
+        }
+        
+        /**
+         * Retrieve the list of known browsers. Specifically, the user agents.
+         *
+         * @return array List of browsers / user agents.
+         * @static 
+         */ 
+        public static function getBrowsers()
+        {
+            //Method inherited from \Mobile_Detect            
+            return \Jenssegers\Agent\Agent::getBrowsers();
+        }
+        
+        /**
+         * Retrieve the list of known utilities.
+         *
+         * @return array List of utilities.
+         * @static 
+         */ 
+        public static function getUtilities()
+        {
+            //Method inherited from \Mobile_Detect            
+            return \Jenssegers\Agent\Agent::getUtilities();
+        }
+        
+        /**
+         * Method gets the mobile detection rules. This method is used for the magic methods $detect->is*().
+         *
+         * @deprecated since version 2.6.9
+         * @return array All the rules (but not extended).
+         * @static 
+         */ 
+        public static function getMobileDetectionRules()
+        {
+            //Method inherited from \Mobile_Detect            
+            return \Jenssegers\Agent\Agent::getMobileDetectionRules();
+        }
+        
+        /**
+         * Method gets the mobile detection rules + utilities.
+         * 
+         * The reason this is separate is because utilities rules
+         * don't necessary imply mobile. This method is used inside
+         * the new $detect->is('stuff') method.
+         *
+         * @deprecated since version 2.6.9
+         * @return array All the rules + extended.
+         * @static 
+         */ 
+        public static function getMobileDetectionRulesExtended()
+        {
+            //Method inherited from \Mobile_Detect            
+            return \Jenssegers\Agent\Agent::getMobileDetectionRulesExtended();
+        }
+        
+        /**
+         * Retrieve the list of mobile operating systems.
+         *
+         * @return array The list of mobile operating systems.
+         * @static 
+         */ 
+        public static function getOperatingSystems()
+        {
+            //Method inherited from \Mobile_Detect            
+            return \Jenssegers\Agent\Agent::getOperatingSystems();
+        }
+        
+        /**
+         * Check the HTTP headers for signs of mobile.
+         * 
+         * This is the fastest mobile check possible; it's used
+         * inside isMobile() method.
+         *
+         * @return bool 
+         * @static 
+         */ 
+        public static function checkHttpHeadersForMobile()
+        {
+            //Method inherited from \Mobile_Detect            
+            return \Jenssegers\Agent\Agent::checkHttpHeadersForMobile();
+        }
+        
+        /**
+         * Check if the device is mobile.
+         * 
+         * Returns true if any type of mobile device detected, including special ones
+         *
+         * @param null $userAgent deprecated
+         * @param null $httpHeaders deprecated
+         * @return bool 
+         * @static 
+         */ 
+        public static function isMobile($userAgent = null, $httpHeaders = null)
+        {
+            //Method inherited from \Mobile_Detect            
+            return \Jenssegers\Agent\Agent::isMobile($userAgent, $httpHeaders);
+        }
+        
+        /**
+         * Check if the device is a tablet.
+         * 
+         * Return true if any type of tablet device is detected.
+         *
+         * @param string $userAgent deprecated
+         * @param array $httpHeaders deprecated
+         * @return bool 
+         * @static 
+         */ 
+        public static function isTablet($userAgent = null, $httpHeaders = null)
+        {
+            //Method inherited from \Mobile_Detect            
+            return \Jenssegers\Agent\Agent::isTablet($userAgent, $httpHeaders);
+        }
+        
+        /**
+         * This method checks for a certain property in the
+         * userAgent.
+         *
+         * @todo : The httpHeaders part is not yet used.
+         * @param string $key
+         * @param string $userAgent deprecated
+         * @param string $httpHeaders deprecated
+         * @return bool|int|null 
+         * @static 
+         */ 
+        public static function is($key, $userAgent = null, $httpHeaders = null)
+        {
+            //Method inherited from \Mobile_Detect            
+            return \Jenssegers\Agent\Agent::is($key, $userAgent, $httpHeaders);
+        }
+        
+        /**
+         * Some detection rules are relative (not standard),
+         * because of the diversity of devices, vendors and
+         * their conventions in representing the User-Agent or
+         * the HTTP headers.
+         * 
+         * This method will be used to check custom regexes against
+         * the User-Agent string.
+         *
+         * @param $regex
+         * @param string $userAgent
+         * @return bool 
+         * @todo : search in the HTTP headers too.
+         * @static 
+         */ 
+        public static function match($regex, $userAgent = null)
+        {
+            //Method inherited from \Mobile_Detect            
+            return \Jenssegers\Agent\Agent::match($regex, $userAgent);
+        }
+        
+        /**
+         * Get the properties array.
+         *
+         * @return array 
+         * @static 
+         */ 
+        public static function getProperties()
+        {
+            //Method inherited from \Mobile_Detect            
+            return \Jenssegers\Agent\Agent::getProperties();
+        }
+        
+        /**
+         * Prepare the version number.
+         *
+         * @todo Remove the error supression from str_replace() call.
+         * @param string $ver The string version, like "2.6.21.2152";
+         * @return float 
+         * @static 
+         */ 
+        public static function prepareVersionNo($ver)
+        {
+            //Method inherited from \Mobile_Detect            
+            return \Jenssegers\Agent\Agent::prepareVersionNo($ver);
+        }
+        
+        /**
+         * Retrieve the mobile grading, using self::MOBILE_GRADE_* constants.
+         *
+         * @return string One of the self::MOBILE_GRADE_* constants.
+         * @static 
+         */ 
+        public static function mobileGrade()
+        {
+            //Method inherited from \Mobile_Detect            
+            return \Jenssegers\Agent\Agent::mobileGrade();
+        }
+         
+    }
+ 
+}
+
 
 namespace  { 
 
@@ -13816,6 +14362,8 @@ namespace  {
     class Excel extends \Maatwebsite\Excel\Facades\Excel {}
 
     class Captcha extends \Mews\Captcha\Facades\Captcha {}
+
+    class Agent extends \Jenssegers\Agent\Facades\Agent {}
  
 }
 

+ 1 - 1
app/Http/Controllers/AdminController.php

@@ -535,7 +535,7 @@ class AdminController extends BaseController
         }
     }
 
-    // 编辑节点
+    // 编辑文章
     public function editArticle(Request $request)
     {
         $id = $request->get('id');

+ 8 - 0
app/Http/Controllers/ArticleController.php

@@ -5,6 +5,7 @@ namespace App\Http\Controllers;
 use App\Http\Models\Article;
 use Illuminate\Http\Request;
 use Response;
+use Agent;
 
 /**
  * 文章控制器
@@ -23,6 +24,13 @@ class ArticleController extends BaseController
             exit('文章已删除');
         }
 
+        $headers = Agent::getHttpHeaders();
+        $browser = Agent::browser();
+        $scriptVersion = Agent::getScriptVersion();
+        $mobileHeaders = Agent::getMobileHeaders();
+        $userAgents = Agent::getUserAgents();
+        dump($headers, $browser, $scriptVersion, $mobileHeaders, $userAgents);
+
         return Response::view('article/detail', $view);
     }
 

+ 1 - 1
app/Http/Controllers/BaseController.php

@@ -123,7 +123,7 @@ class BaseController extends Controller
         $config = $this->systemConfig();
 
         $port = mt_rand($config['min_port'], $config['max_port']);
-        $deny_port = [1068, 1434, 3127, 3128, 3129, 3130, 3332, 4444, 5554, 6669, 8080, 8081, 8082, 8181, 8282, 9996, 17185, 28281]; // 不生成的端口
+        $deny_port = [1068, 1109, 1434, 3127, 3128, 3129, 3130, 3332, 4444, 5554, 6669, 8080, 8081, 8082, 8181, 8282, 9996, 17185, 24554, 28281, 60177, 60179]; // 不生成的端口
 
         $exists_port = User::query()->pluck('port')->toArray();
         if (in_array($port, $exists_port) || in_array($port, $deny_port)) {

+ 1 - 0
app/Http/Controllers/LocateController.php

@@ -5,6 +5,7 @@ namespace App\Http\Controllers;
 use App\Http\Models\ArticleLog;
 use Illuminate\Http\Request;
 use Response;
+use Agent;
 
 /**
  * 定位控制器

+ 8 - 8
app/Http/Controllers/LoginController.php

@@ -63,18 +63,18 @@ class LoginController extends BaseController
             }
 
             // 更新登录信息
-            User::query()->where('id', $user['id'])->update(['last_login' => time()]);
+            User::query()->where('id', $user->id)->update(['last_login' => time()]);
 
             // 登录送积分
             if (self::$config['login_add_score']) {
                 if (!Cache::has('loginAddScore_' . md5($username))) {
                     $score = mt_rand(self::$config['min_rand_score'], self::$config['max_rand_score']);
-                    $ret = User::query()->where('id', $user['id'])->increment('score', $score);
+                    $ret = User::query()->where('id', $user->id)->increment('score', $score);
                     if ($ret) {
                         $obj = new UserScoreLog();
-                        $obj->user_id = $user['id'];
-                        $obj->before = $user['score'];
-                        $obj->after = $user['score'] + $score;
+                        $obj->user_id = $user->id;
+                        $obj->before = $user->score;
+                        $obj->after = $user->score + $score;
                         $obj->score = $score;
                         $obj->desc = '登录送积分';
                         $obj->created_at = date('Y-m-d H:i:s');
@@ -88,12 +88,12 @@ class LoginController extends BaseController
             }
 
             // 重新取出用户信息
-            $user = User::query()->where('id', $user['id'])->first();
+            $userInfo = User::query()->where('id', $user->id)->first();
 
-            $request->session()->put('user', $user->toArray());
+            $request->session()->put('user', $userInfo->toArray());
 
             // 根据权限跳转
-            if ($user['is_admin']) {
+            if ($user->is_admin) {
                 return Redirect::to('admin');
             }
 

+ 1 - 0
composer.json

@@ -8,6 +8,7 @@
         "php": ">=5.6.4",
         "barryvdh/laravel-ide-helper": "^2.4",
         "guzzlehttp/guzzle": "^6.3",
+        "jenssegers/agent": "^2.5",
         "laravel/framework": "5.4.*",
         "laravel/tinker": "~1.0",
         "maatwebsite/excel": "~2.1.0",

+ 169 - 1
composer.lock

@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
         "This file is @generated automatically"
     ],
-    "content-hash": "c3b689972dda94578780a423aa31c71c",
+    "content-hash": "c97b303f7da9900573b399a99d970257",
     "packages": [
         {
             "name": "barryvdh/laravel-ide-helper",
@@ -608,6 +608,122 @@
             ],
             "time": "2015-04-20T18:58:01+00:00"
         },
+        {
+            "name": "jaybizzle/crawler-detect",
+            "version": "v1.2.54",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/JayBizzle/Crawler-Detect.git",
+                "reference": "9af25770d9382917b680009a88497162405bbe48"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://files.phpcomposer.com/files/JayBizzle/Crawler-Detect/9af25770d9382917b680009a88497162405bbe48.zip",
+                "reference": "9af25770d9382917b680009a88497162405bbe48",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.0"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "4.8.*",
+                "satooshi/php-coveralls": "1.*"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "Jaybizzle\\CrawlerDetect\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Mark Beech",
+                    "email": "[email protected]",
+                    "role": "Developer"
+                }
+            ],
+            "description": "CrawlerDetect is a PHP class for detecting bots/crawlers/spiders via the user agent",
+            "homepage": "https://github.com/JayBizzle/Crawler-Detect/",
+            "keywords": [
+                "crawler",
+                "crawler detect",
+                "crawler detector",
+                "crawlerdetect",
+                "php crawler detect"
+            ],
+            "time": "2017-10-28T13:05:55+00:00"
+        },
+        {
+            "name": "jenssegers/agent",
+            "version": "v2.5.2",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/jenssegers/agent.git",
+                "reference": "faf85b10206478382ac93eda122430fee78c544e"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://files.phpcomposer.com/files/jenssegers/agent/faf85b10206478382ac93eda122430fee78c544e.zip",
+                "reference": "faf85b10206478382ac93eda122430fee78c544e",
+                "shasum": ""
+            },
+            "require": {
+                "illuminate/support": "^4.0|^5.0",
+                "jaybizzle/crawler-detect": "^1.2",
+                "mobiledetect/mobiledetectlib": "^2.7.6",
+                "php": ">=5.4.0"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "^4.0|^5.0|^6.0",
+                "satooshi/php-coveralls": "^1.0"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "3.0-dev"
+                },
+                "laravel": {
+                    "providers": [
+                        "Jenssegers\\Agent\\AgentServiceProvider"
+                    ],
+                    "aliases": {
+                        "Agent": "Jenssegers\\Agent\\Facades\\Agent"
+                    }
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Jenssegers\\Agent\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Jens Segers",
+                    "homepage": "https://jenssegers.com"
+                }
+            ],
+            "description": "Desktop/mobile user agent parser with support for Laravel, based on Mobiledetect",
+            "homepage": "https://github.com/jenssegers/agent",
+            "keywords": [
+                "Agent",
+                "browser",
+                "desktop",
+                "laravel",
+                "mobile",
+                "platform",
+                "user agent",
+                "useragent"
+            ],
+            "time": "2017-06-27T06:30:13+00:00"
+        },
         {
             "name": "jeremeamia/SuperClosure",
             "version": "2.3.0",
@@ -1086,6 +1202,58 @@
             ],
             "time": "2017-09-11T14:59:20+00:00"
         },
+        {
+            "name": "mobiledetect/mobiledetectlib",
+            "version": "2.8.26",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/serbanghita/Mobile-Detect.git",
+                "reference": "a0ed86c9d7c04ae27fa6418b55e3beb04dfe3297"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://files.phpcomposer.com/files/serbanghita/Mobile-Detect/a0ed86c9d7c04ae27fa6418b55e3beb04dfe3297.zip",
+                "reference": "a0ed86c9d7c04ae27fa6418b55e3beb04dfe3297",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.0.0"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "*"
+            },
+            "type": "library",
+            "autoload": {
+                "classmap": [
+                    "Mobile_Detect.php"
+                ],
+                "psr-0": {
+                    "Detection": "namespaced/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Serban Ghita",
+                    "email": "[email protected]",
+                    "homepage": "http://mobiledetect.net",
+                    "role": "Developer"
+                }
+            ],
+            "description": "Mobile_Detect is a lightweight PHP class for detecting mobile devices. It uses the User-Agent string combined with specific HTTP headers to detect the mobile environment.",
+            "homepage": "https://github.com/serbanghita/Mobile-Detect",
+            "keywords": [
+                "detect mobile devices",
+                "mobile",
+                "mobile detect",
+                "mobile detector",
+                "php mobile detect"
+            ],
+            "time": "2017-08-29T18:23:54+00:00"
+        },
         {
             "name": "monolog/monolog",
             "version": "1.23.0",

+ 2 - 0
config/app.php

@@ -180,6 +180,7 @@ return [
         Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class,
         Maatwebsite\Excel\ExcelServiceProvider::class,
         Mews\Captcha\CaptchaServiceProvider::class,
+        Jenssegers\Agent\AgentServiceProvider::class,
 
     ],
 
@@ -231,6 +232,7 @@ return [
         'View' => Illuminate\Support\Facades\View::class,
         'Excel' => Maatwebsite\Excel\Facades\Excel::class,
         'Captcha' => Mews\Captcha\Facades\Captcha::class,
+        'Agent' => Jenssegers\Agent\Facades\Agent::class,
 
     ],
 

+ 0 - 1
resources/views/admin/layouts.blade.php

@@ -61,7 +61,6 @@
                     <li class="dropdown dropdown-user dropdown-dark">
                         <a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-close-others="true">
                             <span class="username username-hide-on-mobile"> {{Session::get('user')['username']}} </span>
-                            <!-- DOC: Do not remove below empty space(&nbsp;) as its purposely used -->
                             <img alt="" class="img-circle" src="/assets/images/avatar.jpg" /> </a>
                         <ul class="dropdown-menu dropdown-menu-default">
                             <li>

+ 240 - 201
resources/views/admin/system.blade.php

@@ -56,62 +56,72 @@
                                             <form action="#" method="post" class="form-horizontal">
                                                 <div class="portlet-body">
                                                     <div class="form-group">
-                                                        <label for="website_name" class="col-md-2 control-label">网站名称</label>
-                                                        <div class="col-md-4">
-                                                            <div class="input-group">
-                                                                <input class="form-control" type="text" name="website_name" value="{{$website_name}}" id="website_name" />
-                                                                <span class="input-group-btn">
-                                                                    <button class="btn btn-success" type="button" onclick="setWebsiteName()">修改</button>
-                                                                </span>
+                                                        <div class="col-md-6">
+                                                            <label for="website_name" class="col-md-3 control-label">网站名称</label>
+                                                            <div class="col-md-9">
+                                                                <div class="input-group">
+                                                                    <input class="form-control" type="text" name="website_name" value="{{$website_name}}" id="website_name" />
+                                                                    <span class="input-group-btn">
+                                                                        <button class="btn btn-success" type="button" onclick="setWebsiteName()">修改</button>
+                                                                    </span>
+                                                                </div>
+                                                                <span class="help-block"> 发邮件时展示 </span>
                                                             </div>
-                                                            <span class="help-block"> 发邮件时展示 </span>
                                                         </div>
-                                                    </div>
-                                                    <div class="form-group">
-                                                        <label for="website_url" class="col-md-2 control-label">网站地址</label>
-                                                        <div class="col-md-4">
-                                                            <div class="input-group">
-                                                                <input class="form-control" type="text" name="website_url" value="{{$website_url}}" id="website_url" />
-                                                                <span class="input-group-btn">
+                                                        <div class="col-md-6">
+                                                            <label for="website_url" class="col-md-3 control-label">网站地址</label>
+                                                            <div class="col-md-9">
+                                                                <div class="input-group">
+                                                                    <input class="form-control" type="text" name="website_url" value="{{$website_url}}" id="website_url" />
+                                                                    <span class="input-group-btn">
                                                                     <button class="btn btn-success" type="button" onclick="setWebsiteUrl()">修改</button>
                                                                 </span>
+                                                                </div>
+                                                                <span class="help-block"> 生成重置密码必备,示例:https://github.com </span>
                                                             </div>
-                                                            <span class="help-block"> 生成重置密码必备,示例:https://github.com </span>
                                                         </div>
                                                     </div>
                                                     <div class="form-group">
-                                                        <label for="is_register" class="col-md-2 control-label">用户注册</label>
                                                         <div class="col-md-6">
-                                                            <input type="checkbox" class="make-switch" @if($is_register) checked @endif id="is_register" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
-                                                            <span class="help-block"> 关闭后无法注册 </span>
+                                                            <label for="is_register" class="col-md-3 control-label">用户注册</label>
+                                                            <div class="col-md-9">
+                                                                <input type="checkbox" class="make-switch" @if($is_register) checked @endif id="is_register" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
+                                                                <span class="help-block"> 关闭后无法注册 </span>
+                                                            </div>
                                                         </div>
-                                                    </div>
-                                                    <div class="form-group">
-                                                        <label for="is_invite_register" class="col-md-2 control-label">邀请注册</label>
                                                         <div class="col-md-6">
-                                                            <input type="checkbox" class="make-switch" @if($is_invite_register) checked @endif id="is_invite_register" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
-                                                            <span class="help-block"> 启用后必须使用邀请码进行注册 </span>
+                                                            <label for="is_active_register" class="col-md-3 control-label">激活账号</label>
+                                                            <div class="col-md-9">
+                                                                <input type="checkbox" class="make-switch" @if($is_active_register) checked @endif id="is_active_register" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
+                                                                <span class="help-block"> 启用后用户需要通过邮件来激活账号 </span>
+                                                            </div>
                                                         </div>
                                                     </div>
                                                     <div class="form-group">
-                                                        <label for="is_active_register" class="col-md-2 control-label">激活账号</label>
                                                         <div class="col-md-6">
-                                                            <input type="checkbox" class="make-switch" @if($is_active_register) checked @endif id="is_active_register" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
-                                                            <span class="help-block"> 启用后用户需要通过邮件来激活账号 </span>
+                                                            <label for="is_invite_register" class="col-md-3 control-label">邀请注册</label>
+                                                            <div class="col-md-9">
+                                                                <input type="checkbox" class="make-switch" @if($is_invite_register) checked @endif id="is_invite_register" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
+                                                                <span class="help-block"> 启用后必须使用邀请码进行注册 </span>
+                                                            </div>
                                                         </div>
-                                                    </div>
-                                                    <div class="form-group">
-                                                        <label for="is_reset_password" class="col-md-2 control-label">重置密码</label>
                                                         <div class="col-md-6">
-                                                            <input type="checkbox" class="make-switch" @if($is_reset_password) checked @endif id="is_reset_password" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
-                                                            <span class="help-block"> 启用后用户可以通过邮件重置密码 </span>
+                                                            <label for="is_reset_password" class="col-md-3 control-label">重置密码</label>
+                                                            <div class="col-md-9">
+                                                                <input type="checkbox" class="make-switch" @if($is_reset_password) checked @endif id="is_reset_password" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
+                                                                <span class="help-block"> 启用后用户可以通过邮件重置密码 </span>
+                                                            </div>
                                                         </div>
                                                     </div>
                                                     <div class="form-group">
-                                                        <label for="is_captcha" class="col-md-2 control-label">验证码</label>
                                                         <div class="col-md-6">
-                                                            <input type="checkbox" class="make-switch" @if($is_captcha) checked @endif id="is_captcha" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
-                                                            <span class="help-block"> 启用后登录、注册需要输入验证码 </span>
+                                                            <label for="is_captcha" class="col-md-3 control-label">验证码</label>
+                                                            <div class="col-md-9">
+                                                                <input type="checkbox" class="make-switch" @if($is_captcha) checked @endif id="is_captcha" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
+                                                                <span class="help-block"> 启用后登录、注册需要输入验证码 </span>
+                                                            </div>
+                                                        </div>
+                                                        <div class="col-md-6">
                                                         </div>
                                                     </div>
                                                 </div>
@@ -121,19 +131,22 @@
                                             <form action="#" method="post" class="form-horizontal">
                                                 <div class="portlet-body">
                                                     <div class="form-group">
-                                                        <label for="is_rand_port" class="col-md-2 control-label">随机端口</label>
                                                         <div class="col-md-6">
-                                                            <input type="checkbox" class="make-switch" @if($is_rand_port) checked @endif id="is_rand_port" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
-                                                            <span class="help-block"> 添加账号时随机生成端口 </span>
+                                                            <label for="is_rand_port" class="col-md-3 control-label">随机端口</label>
+                                                            <div class="col-md-9">
+                                                                <input type="checkbox" class="make-switch" @if($is_rand_port) checked @endif id="is_rand_port" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
+                                                                <span class="help-block"> 注册、添加账号时随机生成端口 </span>
+                                                            </div>
                                                         </div>
-                                                    </div>
-                                                    <div class="form-group">
-                                                        <label class="col-md-2 control-label">端口范围</label>
-                                                        <div class="col-md-2">
-                                                            <div class="input-group input-large input-daterange">
-                                                                <input type="text" class="form-control" name="min_port" value="{{$min_port}}" id="min_port">
-                                                                <span class="input-group-addon"> ~ </span>
-                                                                <input type="text" class="form-control" name="max_port" value="{{$max_port}}" id="max_port">
+                                                        <div class="col-md-6">
+                                                            <label class="col-md-3 control-label">端口范围</label>
+                                                            <div class="col-md-9">
+                                                                <div class="input-group input-large input-daterange">
+                                                                    <input type="text" class="form-control" name="min_port" value="{{$min_port}}" id="min_port">
+                                                                    <span class="input-group-addon"> ~ </span>
+                                                                    <input type="text" class="form-control" name="max_port" value="{{$max_port}}" id="max_port">
+                                                                </div>
+                                                                <span class="help-block"> 端口范围:1000 - 65535 </span>
                                                             </div>
                                                         </div>
                                                     </div>
@@ -147,77 +160,83 @@
                                                     </div>
                                                     -->
                                                     <div class="form-group">
-                                                        <label for="default_days" class="col-md-2 control-label">初始有效期</label>
-                                                        <div class="col-md-3">
-                                                            <div class="input-group">
-                                                                <input class="form-control" type="text" name="default_days" value="{{$default_days}}" id="default_days" />
-                                                                <span class="input-group-addon">天</span>
-                                                                <span class="input-group-btn">
-                                                                    <button class="btn btn-success" type="button" onclick="setDefaultDays()">修改</button>
-                                                                </span>
+                                                        <div class="col-md-6">
+                                                            <label for="default_days" class="col-md-3 control-label">初始有效期</label>
+                                                            <div class="col-md-9">
+                                                                <div class="input-group">
+                                                                    <input class="form-control" type="text" name="default_days" value="{{$default_days}}" id="default_days" />
+                                                                    <span class="input-group-addon">天</span>
+                                                                    <span class="input-group-btn">
+                                                                        <button class="btn btn-success" type="button" onclick="setDefaultDays()">修改</button>
+                                                                    </span>
+                                                                </div>
+                                                                <span class="help-block"> 用户注册时默认SS(R)有效天数 </span>
                                                             </div>
-                                                            <span class="help-block"> 用户注册时默认SS(R)有效天数 </span>
                                                         </div>
-                                                    </div>
-                                                    <div class="form-group">
-                                                        <label for="default_traffic" class="col-md-2 control-label">初始流量</label>
-                                                        <div class="col-md-3">
-                                                            <div class="input-group">
-                                                                <input class="form-control" type="text" name="default_traffic" value="{{$default_traffic}}" id="default_traffic" />
-                                                                <span class="input-group-addon">MiB</span>
-                                                                <span class="input-group-btn">
+                                                        <div class="col-md-6">
+                                                            <label for="default_traffic" class="col-md-3 control-label">初始流量</label>
+                                                            <div class="col-md-9">
+                                                                <div class="input-group">
+                                                                    <input class="form-control" type="text" name="default_traffic" value="{{$default_traffic}}" id="default_traffic" />
+                                                                    <span class="input-group-addon">MiB</span>
+                                                                    <span class="input-group-btn">
                                                                     <button class="btn btn-success" type="button" onclick="setDefaultTraffic()">修改</button>
                                                                 </span>
+                                                                </div>
+                                                                <span class="help-block"> 用户注册时默认可用流量 </span>
                                                             </div>
-                                                            <span class="help-block"> 用户注册时默认可用流量 </span>
                                                         </div>
                                                     </div>
                                                     <div class="form-group">
-                                                        <label for="invite_num" class="col-md-2 control-label">可生成邀请码数</label>
-                                                        <div class="col-md-3">
-                                                            <div class="input-group">
-                                                                <input class="form-control" type="text" name="invite_num" value="{{$invite_num}}" id="invite_num" />
-                                                                <span class="input-group-btn">
-                                                                    <button class="btn btn-success" type="button" onclick="setInviteNum()">修改</button>
-                                                                </span>
+                                                        <div class="col-md-6">
+                                                            <label for="invite_num" class="col-md-3 control-label">可生成邀请码数</label>
+                                                            <div class="col-md-9">
+                                                                <div class="input-group">
+                                                                    <input class="form-control" type="text" name="invite_num" value="{{$invite_num}}" id="invite_num" />
+                                                                    <span class="input-group-btn">
+                                                                        <button class="btn btn-success" type="button" onclick="setInviteNum()">修改</button>
+                                                                    </span>
+                                                                </div>
+                                                                <span class="help-block"> 用户可以生成的邀请码数 </span>
                                                             </div>
-                                                            <span class="help-block"> 用户可以生成的邀请码数 </span>
                                                         </div>
-                                                    </div>
-                                                    <div class="form-group">
-                                                        <label for="reset_password_times" class="col-md-2 control-label">重置密码次数</label>
-                                                        <div class="col-md-3">
-                                                            <div class="input-group">
-                                                                <input class="form-control" type="text" name="reset_password_times" value="{{$reset_password_times}}" id="reset_password_times" />
-                                                                <span class="input-group-btn">
+                                                        <div class="col-md-6">
+                                                            <label for="reset_password_times" class="col-md-3 control-label">重置密码次数</label>
+                                                            <div class="col-md-9">
+                                                                <div class="input-group">
+                                                                    <input class="form-control" type="text" name="reset_password_times" value="{{$reset_password_times}}" id="reset_password_times" />
+                                                                    <span class="input-group-btn">
                                                                     <button class="btn btn-success" type="button" onclick="setResetPasswordTimes()">修改</button>
                                                                 </span>
+                                                                </div>
+                                                                <span class="help-block"> 24小时内可以通过邮件重置密码次数 </span>
                                                             </div>
-                                                            <span class="help-block"> 24小时内可以通过邮件重置密码次数 </span>
                                                         </div>
                                                     </div>
                                                     <div class="form-group">
-                                                        <label for="active_times" class="col-md-2 control-label">激活账号次数</label>
-                                                        <div class="col-md-3">
-                                                            <div class="input-group">
-                                                                <input class="form-control" type="text" name="active_times" value="{{$active_times}}" id="active_times" />
-                                                                <span class="input-group-btn">
-                                                                    <button class="btn btn-success" type="button" onclick="setActiveTimes()">修改</button>
-                                                                </span>
+                                                        <div class="col-md-6">
+                                                            <label for="active_times" class="col-md-3 control-label">激活账号次数</label>
+                                                            <div class="col-md-9">
+                                                                <div class="input-group">
+                                                                    <input class="form-control" type="text" name="active_times" value="{{$active_times}}" id="active_times" />
+                                                                    <span class="input-group-btn">
+                                                                        <button class="btn btn-success" type="button" onclick="setActiveTimes()">修改</button>
+                                                                    </span>
+                                                                </div>
+                                                                <span class="help-block"> 24小时内可以通过邮件激活账号次数 </span>
                                                             </div>
-                                                            <span class="help-block"> 24小时内可以通过邮件激活账号次数 </span>
                                                         </div>
-                                                    </div>
-                                                    <div class="form-group">
-                                                        <label for="subscribe_max" class="col-md-2 control-label">订阅节点数</label>
-                                                        <div class="col-md-3">
-                                                            <div class="input-group">
-                                                                <input class="form-control" type="text" name="subscribe_max" value="{{$subscribe_max}}" id="subscribe_max" />
-                                                                <span class="input-group-btn">
+                                                        <div class="col-md-6">
+                                                            <label for="subscribe_max" class="col-md-3 control-label">订阅节点数</label>
+                                                            <div class="col-md-9">
+                                                                <div class="input-group">
+                                                                    <input class="form-control" type="text" name="subscribe_max" value="{{$subscribe_max}}" id="subscribe_max" />
+                                                                    <span class="input-group-btn">
                                                                     <button class="btn btn-success" type="button" onclick="setSubscribeMax()">修改</button>
                                                                 </span>
+                                                                </div>
+                                                                <span class="help-block"> 客户端订阅时随机取得几个节点 </span>
                                                             </div>
-                                                            <span class="help-block"> 客户端订阅时随机取得几个节点 </span>
                                                         </div>
                                                     </div>
                                                 </div>
@@ -227,33 +246,39 @@
                                             <form action="#" method="post" class="form-horizontal">
                                                 <div class="portlet-body">
                                                     <div class="form-group">
-                                                        <label for="login_add_score" class="col-md-2 control-label">登录加积分</label>
                                                         <div class="col-md-6">
-                                                            <input type="checkbox" class="make-switch" @if($login_add_score) checked @endif id="login_add_score" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
-                                                            <span class="help-block"> 登录时将根据积分范围得到积分 </span>
+                                                            <label for="login_add_score" class="col-md-3 control-label">登录加积分</label>
+                                                            <div class="col-md-9">
+                                                                <input type="checkbox" class="make-switch" @if($login_add_score) checked @endif id="login_add_score" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
+                                                                <span class="help-block"> 登录时将根据积分范围得到积分 </span>
+                                                            </div>
                                                         </div>
-                                                    </div>
-                                                    <div class="form-group">
-                                                        <label for="login_add_score_range" class="col-md-2 control-label">时间间隔</label>
-                                                        <div class="col-md-2">
-                                                            <div class="input-group">
-                                                                <input class="form-control" type="text" name="login_add_score_range" value="{{$login_add_score_range}}" id="login_add_score_range" />
-                                                                <span class="input-group-btn">
+                                                        <div class="col-md-6">
+                                                            <label for="login_add_score_range" class="col-md-3 control-label">时间间隔</label>
+                                                            <div class="col-md-9">
+                                                                <div class="input-group">
+                                                                    <input class="form-control" type="text" name="login_add_score_range" value="{{$login_add_score_range}}" id="login_add_score_range" />
+                                                                    <span class="input-group-btn">
                                                                     <button class="btn btn-success" type="button" onclick="setLoginAddScoreRange()">修改</button>
                                                                 </span>
+                                                                </div>
+                                                                <span class="help-block"> 每隔多久登录才会加积分(单位分钟) </span>
                                                             </div>
-                                                            <span class="help-block"> 每隔多久登录才会加积分(单位分钟) </span>
                                                         </div>
                                                     </div>
                                                     <div class="form-group">
-                                                        <label class="col-md-2 control-label">积分范围</label>
-                                                        <div class="col-md-2">
-                                                            <div class="input-group input-large input-daterange">
-                                                                <input type="text" class="form-control" name="min_rand_score" value="{{$min_rand_score}}" id="min_rand_score">
-                                                                <span class="input-group-addon"> ~ </span>
-                                                                <input type="text" class="form-control" name="max_rand_score" value="{{$max_rand_score}}" id="max_rand_score">
+                                                        <div class="col-md-6">
+                                                            <label class="col-md-3 control-label">积分范围</label>
+                                                            <div class="col-md-9">
+                                                                <div class="input-group input-large input-daterange">
+                                                                    <input type="text" class="form-control" name="min_rand_score" value="{{$min_rand_score}}" id="min_rand_score">
+                                                                    <span class="input-group-addon"> ~ </span>
+                                                                    <input type="text" class="form-control" name="max_rand_score" value="{{$max_rand_score}}" id="max_rand_score">
+                                                                </div>
                                                             </div>
                                                         </div>
+                                                        <div class="col-md-6">
+                                                        </div>
                                                     </div>
                                                 </div>
                                             </form>
@@ -262,49 +287,53 @@
                                             <form action="#" method="post" class="form-horizontal">
                                                 <div class="portlet-body">
                                                     <div class="form-group">
-                                                        <label for="referral_status" class="col-md-2 control-label">本功能</label>
                                                         <div class="col-md-6">
-                                                            <input type="checkbox" class="make-switch" @if($referral_status) checked @endif id="referral_status" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
-                                                            <span class="help-block"> 关闭后用户不可见 </span>
+                                                            <label for="referral_status" class="col-md-3 control-label">本功能</label>
+                                                            <div class="col-md-9">
+                                                                <input type="checkbox" class="make-switch" @if($referral_status) checked @endif id="referral_status" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
+                                                                <span class="help-block"> 关闭后用户不可见 </span>
+                                                            </div>
                                                         </div>
-                                                    </div>
-                                                    <div class="form-group">
-                                                        <label for="referral_traffic" class="col-md-2 control-label">注册送流量</label>
-                                                        <div class="col-md-3">
-                                                            <div class="input-group">
-                                                                <input class="form-control" type="text" name="referral_gift_traffic" value="{{$referral_traffic}}" id="referral_traffic" />
-                                                                <span class="input-group-addon">MiB</span>
-                                                                <span class="input-group-btn">
+                                                        <div class="col-md-6">
+                                                            <label for="referral_traffic" class="col-md-3 control-label">注册送流量</label>
+                                                            <div class="col-md-9">
+                                                                <div class="input-group">
+                                                                    <input class="form-control" type="text" name="referral_gift_traffic" value="{{$referral_traffic}}" id="referral_traffic" />
+                                                                    <span class="input-group-addon">MiB</span>
+                                                                    <span class="input-group-btn">
                                                                     <button class="btn btn-success" type="button" onclick="setReferralTraffic()">修改</button>
                                                                 </span>
+                                                                </div>
+                                                                <span class="help-block"> 根据推广链接注册则送多少流量(叠加在默认流量上) </span>
                                                             </div>
-                                                            <span class="help-block"> 根据推广链接注册则送多少流量(叠加在默认流量上) </span>
                                                         </div>
                                                     </div>
                                                     <div class="form-group">
-                                                        <label for="referral_percent" class="col-md-2 control-label">返利比例</label>
-                                                        <div class="col-md-3">
-                                                            <div class="input-group">
-                                                                <input class="form-control" type="text" name="referral_percent" value="{{$referral_percent * 100}}" id="referral_percent" />
-                                                                <span class="input-group-addon">%</span>
-                                                                <span class="input-group-btn">
-                                                                    <button class="btn btn-success" type="button" onclick="setReferralPercent()">修改</button>
-                                                                </span>
+                                                        <div class="col-md-6">
+                                                            <label for="referral_percent" class="col-md-3 control-label">返利比例</label>
+                                                            <div class="col-md-9">
+                                                                <div class="input-group">
+                                                                    <input class="form-control" type="text" name="referral_percent" value="{{$referral_percent * 100}}" id="referral_percent" />
+                                                                    <span class="input-group-addon">%</span>
+                                                                    <span class="input-group-btn">
+                                                                        <button class="btn btn-success" type="button" onclick="setReferralPercent()">修改</button>
+                                                                    </span>
+                                                                </div>
+                                                                <span class="help-block"> 根据推广链接注册的账号每笔消费推广人可以分成的比例 </span>
                                                             </div>
-                                                            <span class="help-block"> 根据推广链接注册的账号每笔消费推广人可以分成的比例 </span>
                                                         </div>
-                                                    </div>
-                                                    <div class="form-group">
-                                                        <label for="referral_money" class="col-md-2 control-label">提现限制</label>
-                                                        <div class="col-md-3">
-                                                            <div class="input-group">
-                                                                <input class="form-control" type="text" name="referral_money" value="{{$referral_money}}" id="referral_money" />
-                                                                <span class="input-group-addon">元</span>
-                                                                <span class="input-group-btn">
+                                                        <div class="col-md-6">
+                                                            <label for="referral_money" class="col-md-3 control-label">提现限制</label>
+                                                            <div class="col-md-9">
+                                                                <div class="input-group">
+                                                                    <input class="form-control" type="text" name="referral_money" value="{{$referral_money}}" id="referral_money" />
+                                                                    <span class="input-group-addon">元</span>
+                                                                    <span class="input-group-btn">
                                                                     <button class="btn btn-success" type="button" onclick="setReferralMoney()">修改</button>
                                                                 </span>
+                                                                </div>
+                                                                <span class="help-block"> 满多少元才可以申请提现 </span>
                                                             </div>
-                                                            <span class="help-block"> 满多少元才可以申请提现 </span>
                                                         </div>
                                                     </div>
                                                 </div>
@@ -314,50 +343,58 @@
                                             <form action="#" method="post" class="form-horizontal">
                                                 <div class="portlet-body">
                                                     <div class="form-group">
-                                                        <label for="reset_traffic" class="col-md-2 control-label">流量自动重置</label>
                                                         <div class="col-md-6">
-                                                            <input type="checkbox" class="make-switch" @if($reset_traffic) checked @endif id="reset_traffic" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
-                                                            <span class="help-block"> 每月1日自动重置账号可用流量 </span>
+                                                            <label for="reset_traffic" class="col-md-3 control-label">流量自动重置</label>
+                                                            <div class="col-md-9">
+                                                                <input type="checkbox" class="make-switch" @if($reset_traffic) checked @endif id="reset_traffic" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
+                                                                <span class="help-block"> 每月1日自动重置账号可用流量 </span>
+                                                            </div>
                                                         </div>
-                                                    </div>
-                                                    <div class="form-group">
-                                                        <label for="expire_warning" class="col-md-2 control-label">过期警告</label>
                                                         <div class="col-md-6">
-                                                            <input type="checkbox" class="make-switch" @if($expire_warning) checked @endif id="expire_warning" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
-                                                            <span class="help-block"> 启用后账号距到期还剩阈值设置的值时自动发邮件提醒用户 </span>
                                                         </div>
                                                     </div>
                                                     <div class="form-group">
-                                                        <label for="expire_days" class="col-md-2 control-label">过期警告阈值</label>
-                                                        <div class="col-md-3">
-                                                            <div class="input-group">
-                                                                <input class="form-control" type="text" name="expire_days" value="{{$expire_days}}" id="expire_days" />
-                                                                <span class="input-group-addon">天</span>
-                                                                <span class="input-group-btn">
+                                                        <div class="col-md-6">
+                                                            <label for="expire_warning" class="col-md-3 control-label">过期警告</label>
+                                                            <div class="col-md-9">
+                                                                <input type="checkbox" class="make-switch" @if($expire_warning) checked @endif id="expire_warning" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
+                                                                <span class="help-block"> 启用后账号距到期还剩阈值设置的值时自动发邮件提醒用户 </span>
+                                                            </div>
+                                                        </div>
+                                                        <div class="col-md-6">
+                                                            <label for="expire_days" class="col-md-3 control-label">过期警告阈值</label>
+                                                            <div class="col-md-9">
+                                                                <div class="input-group">
+                                                                    <input class="form-control" type="text" name="expire_days" value="{{$expire_days}}" id="expire_days" />
+                                                                    <span class="input-group-addon">天</span>
+                                                                    <span class="input-group-btn">
                                                                     <button class="btn btn-success" type="button" onclick="setExpireDays()">修改</button>
                                                                 </span>
+                                                                </div>
+                                                                <span class="help-block"> 账号距离过期还差多少天时发警告邮件 </span>
                                                             </div>
-                                                            <span class="help-block"> 账号距离过期还差多少天时发警告邮件 </span>
                                                         </div>
                                                     </div>
                                                     <div class="form-group">
-                                                        <label for="traffic_warning" class="col-md-2 control-label">流量警告</label>
                                                         <div class="col-md-6">
-                                                            <input type="checkbox" class="make-switch" @if($traffic_warning) checked @endif id="traffic_warning" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
-                                                            <span class="help-block"> 启用后账号已使用流量超过警告阈值时自动发邮件提醒用户 </span>
+                                                            <label for="traffic_warning" class="col-md-3 control-label">流量警告</label>
+                                                            <div class="col-md-9">
+                                                                <input type="checkbox" class="make-switch" @if($traffic_warning) checked @endif id="traffic_warning" data-on-color="success" data-off-color="danger" data-on-text="启用" data-off-text="关闭">
+                                                                <span class="help-block"> 启用后账号已使用流量超过警告阈值时自动发邮件提醒用户 </span>
+                                                            </div>
                                                         </div>
-                                                    </div>
-                                                    <div class="form-group">
-                                                        <label for="traffic_warning_percent" class="col-md-2 control-label">流量警告阈值</label>
-                                                        <div class="col-md-3">
-                                                            <div class="input-group">
-                                                                <input class="form-control" type="text" name="traffic_warning_percent" value="{{$traffic_warning_percent}}" id="traffic_warning_percent" />
-                                                                <span class="input-group-addon">%</span>
-                                                                <span class="input-group-btn">
+                                                        <div class="col-md-6">
+                                                            <label for="traffic_warning_percent" class="col-md-3 control-label">流量警告阈值</label>
+                                                            <div class="col-md-9">
+                                                                <div class="input-group">
+                                                                    <input class="form-control" type="text" name="traffic_warning_percent" value="{{$traffic_warning_percent}}" id="traffic_warning_percent" />
+                                                                    <span class="input-group-addon">%</span>
+                                                                    <span class="input-group-btn">
                                                                     <button class="btn btn-success" type="button" onclick="setTrafficWarningPercent()">修改</button>
                                                                 </span>
+                                                                </div>
+                                                                <span class="help-block"> 建议设置在70%~90% </span>
                                                             </div>
-                                                            <span class="help-block"> 建议设置在70%~90% </span>
                                                         </div>
                                                     </div>
                                                 </div>
@@ -368,47 +405,49 @@
                                                 <div class="form-body">
                                                     <div class="portlet-body">
                                                         <div class="form-group">
-                                                            <label class="col-md-2 control-label">微信</label>
                                                             <div class="col-md-6">
-                                                                <div class="fileinput fileinput-new" data-provides="fileinput">
-                                                                    <div class="fileinput-new thumbnail" style="width: 200px; height: 150px;">
-                                                                        @if ($wechat_qrcode)
-                                                                            <img src="{{$wechat_qrcode}}" alt="" />
-                                                                        @else
-                                                                            <img src="/assets/images/noimage.png" alt="" />
-                                                                        @endif
-                                                                    </div>
-                                                                    <div class="fileinput-preview fileinput-exists thumbnail" style="max-width: 200px; max-height: 150px;"> </div>
-                                                                    <div>
-                                                                        <span class="btn default btn-file">
-                                                                            <span class="fileinput-new"> 选择 </span>
-                                                                            <span class="fileinput-exists"> 更换 </span>
-                                                                            <input type="file" name="wechat_qrcode" id="wechat_qrcode">
-                                                                        </span>
-                                                                        <a href="javascript:;" class="btn red fileinput-exists" data-dismiss="fileinput"> 移除 </a>
+                                                                <label class="col-md-5 control-label">微信</label>
+                                                                <div class="col-md-7">
+                                                                    <div class="fileinput fileinput-new" data-provides="fileinput">
+                                                                        <div class="fileinput-new thumbnail" style="width: 200px; height: 150px;">
+                                                                            @if ($wechat_qrcode)
+                                                                                <img src="{{$wechat_qrcode}}" alt="" />
+                                                                            @else
+                                                                                <img src="/assets/images/noimage.png" alt="" />
+                                                                            @endif
+                                                                        </div>
+                                                                        <div class="fileinput-preview fileinput-exists thumbnail" style="max-width: 200px; max-height: 150px;"> </div>
+                                                                        <div>
+                                                                            <span class="btn default btn-file">
+                                                                                <span class="fileinput-new"> 选择 </span>
+                                                                                <span class="fileinput-exists"> 更换 </span>
+                                                                                <input type="file" name="wechat_qrcode" id="wechat_qrcode">
+                                                                            </span>
+                                                                            <a href="javascript:;" class="btn red fileinput-exists" data-dismiss="fileinput"> 移除 </a>
+                                                                        </div>
                                                                     </div>
                                                                 </div>
                                                             </div>
-                                                        </div>
-                                                        <div class="form-group">
-                                                            <label class="col-md-2 control-label">支付宝</label>
                                                             <div class="col-md-6">
-                                                                <div class="fileinput fileinput-new" data-provides="fileinput">
-                                                                    <div class="fileinput-new thumbnail" style="width: 200px; height: 150px;">
-                                                                        @if ($alipay_qrcode)
-                                                                            <img src="{{$alipay_qrcode}}" alt="" />
-                                                                        @else
-                                                                            <img src="/assets/images/noimage.png" alt="" />
-                                                                        @endif
-                                                                    </div>
-                                                                    <div class="fileinput-preview fileinput-exists thumbnail" style="max-width: 200px; max-height: 150px;"> </div>
-                                                                    <div>
+                                                                <label class="col-md-5 control-label">支付宝</label>
+                                                                <div class="col-md-7">
+                                                                    <div class="fileinput fileinput-new" data-provides="fileinput">
+                                                                        <div class="fileinput-new thumbnail" style="width: 200px; height: 150px;">
+                                                                            @if ($alipay_qrcode)
+                                                                                <img src="{{$alipay_qrcode}}" alt="" />
+                                                                            @else
+                                                                                <img src="/assets/images/noimage.png" alt="" />
+                                                                            @endif
+                                                                        </div>
+                                                                        <div class="fileinput-preview fileinput-exists thumbnail" style="max-width: 200px; max-height: 150px;"> </div>
+                                                                        <div>
                                                                         <span class="btn default btn-file">
                                                                             <span class="fileinput-new"> 选择 </span>
                                                                             <span class="fileinput-exists"> 更换 </span>
                                                                             <input type="file" name="alipay_qrcode" id="alipay_qrcode">
                                                                         </span>
-                                                                        <a href="javascript:;" class="btn red fileinput-exists" data-dismiss="fileinput"> 移除 </a>
+                                                                            <a href="javascript:;" class="btn red fileinput-exists" data-dismiss="fileinput"> 移除 </a>
+                                                                        </div>
                                                                     </div>
                                                                 </div>
                                                             </div>

+ 1 - 1
resources/views/login.blade.php

@@ -65,7 +65,7 @@
             <input type="hidden" name="_token" value="{{csrf_token()}}" />
         </div>
         @if($is_captcha)
-            <div class="form-group">
+            <div class="form-group" style="margin-bottom:65px;">
                 <label class="control-label visible-ie8 visible-ie9">验证码</label>
                 <input class="form-control form-control-solid placeholder-no-fix" style="width:60%;float:left;" type="text" autocomplete="off" placeholder="验证码" name="captcha" value="" />
                 <img src="{{captcha_src()}}" onclick="this.src='/captcha/default?'+Math.random()" alt="验证码" style="float:right;" />

+ 1 - 1
resources/views/register.blade.php

@@ -67,7 +67,7 @@
                 </div>
             @endif
             @if($is_captcha)
-            <div class="form-group padding-bottom-20">
+            <div class="form-group" style="margin-bottom:75px;">
                 <label class="control-label visible-ie8 visible-ie9">验证码</label>
                 <input class="form-control placeholder-no-fix" style="width:60%;float:left;" type="text" autocomplete="off" placeholder="验证码" name="captcha" value="" required />
                 <img src="{{captcha_src()}}" onclick="this.src='/captcha/default?'+Math.random()" alt="验证码" style="float:right;" />