NuclearDispersionSystem/ant-design-vue-jeecg/node_modules/xe-utils/methods/web/getBaseURL.js
2023-09-14 14:47:11 +08:00

17 lines
474 B
Java

var staticLocation = require('../static/staticLocation')
var helperGetLocatOrigin = require('./helperGetLocatOrigin')
var lastIndexOf = require('../base/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