Do you want to get base url in magento 2 ? just use this code.

$currentStore = $storeManager->getStore();

$baseUrl = $currentStore->getBaseUrl();