request()->url(); 或者 $_SERVER['SERVER_LISTEN']; 或者 $http = "http://"; if (isset($_SERVER['HTTPS']) && isset($_SERVER['SERVER_PORT'])) { if (($_SERVER['HTTPS'] != 'off') || ($_SERVER['SERVER_PORT'] == 443)) { $http = "https://"; } }
谢谢大佬
request()->url();
或者
$_SERVER['SERVER_LISTEN'];
或者
$http = "http://";
if (isset($_SERVER['HTTPS']) && isset($_SERVER['SERVER_PORT'])) {
if (($_SERVER['HTTPS'] != 'off') || ($_SERVER['SERVER_PORT'] == 443)) {
$http = "https://";
}
}
谢谢大佬