domain(true) . (! in_array(request()->port(), [ 80, 443 ]) ? ':' . request()->port() : '') . '/' . $uri; } else { $storage = Cache::get('STORAGE_ENGINE'); if (!$storage) { $storage = ConfigService::get('storage', $default); Cache::set('STORAGE_ENGINE', $storage); } return $storage ? $storage['domain'] . '/' . $uri : $uri; } } /** * @notes 转相对路径 * @param $uri * @return mixed * @author 张无忌 * @date 2021/7/28 15:09 */ public static function setFileUrl($uri) { $default = ConfigService::get('storage', 'default', 'local'); if ($default === 'local') { $domain = request()->domain(); return str_replace($domain.'/', '', $uri); } else { $storage = ConfigService::get('storage', $default); return str_replace($storage['domain'].'/', '', $uri); } } }