Files
number_zj/20220330_Vote/Ewide.Web.Entry/wwwroot/lib/xe-utils/getBaseURL.js
毛财君 197b38ca6f 1
2023-07-06 17:37:33 +08:00

17 lines
460 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