django-vue3-admin-web/node_modules/xe-utils/getBaseURL.js
2025-10-20 21:21:14 +08:00

17 lines
476 B
JavaScript

var staticLocation = require('./staticLocation')
var helperGetLocatOrigin = require('./helperGetLocatOrigin')
var lastIndexOf = require('./lastIndexOf')
function getBaseURL () {
if (staticLocation) {
var pathname = staticLocation.pathname
var lastIndex = lastIndexOf(pathname, '/') + 1
return helperGetLocatOrigin() + (lastIndex === pathname.length ? pathname : pathname.substring(0, lastIndex))
}
return ''
}
module.exports = getBaseURL