weaver_trunk_cli/pc4mobx/portal4public/util/pathUtil.js

15 lines
318 B
JavaScript
Raw Normal View History

2024-02-26 15:58:58 +08:00
/**
* 添加多级路径
*
* @param {*} url
*/
export const addContentPath = (url) => {
const ecologyContentPath = window.ecologyContentPath;
if (url && ecologyContentPath) {
if (url.startsWith('/') && !url.startsWith(ecologyContentPath)) {
url = ecologyContentPath + url;
}
}
return url;
};