diff --git a/app/Services/Http.php b/app/Services/Http.php index 937e4946..1ad8f28e 100644 --- a/app/Services/Http.php +++ b/app/Services/Http.php @@ -59,11 +59,6 @@ class Http return $_SERVER["REQUEST_URI"]; } - public static function getCurrentUrl() - { - return self::getBaseUrl().$_SERVER["REQUEST_URI"]; - } - public static function getBaseUrl() { $base_url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? "https://" : "http://"; @@ -73,6 +68,22 @@ class Http return $base_url; } + public static function getCurrentUrl() + { + return self::getBaseUrl().$_SERVER["REQUEST_URI"]; + } + + /** + * Generate absolute url according to relative one + * + * @param string $relative + * @return string + */ + public static function urlTo($relative) + { + return Option::get('site_url').$relative; + } + public static function abort($code, $msg = "Something happened.", $is_json = false) { http_response_code((int)$code); diff --git a/resources/views/admin/options.tpl b/resources/views/admin/options.tpl index 67c2e70c..04380b1c 100644 --- a/resources/views/admin/options.tpl +++ b/resources/views/admin/options.tpl @@ -66,7 +66,7 @@ - + 站点地址(URL) diff --git a/resources/views/skinlib/master.tpl b/resources/views/skinlib/master.tpl index 77146a6c..37547038 100644 --- a/resources/views/skinlib/master.tpl +++ b/resources/views/skinlib/master.tpl @@ -75,9 +75,7 @@