b359f9eac6
* feat: supports subdirectory deployment * feat: auto publicPath * fix: buildIndexHtml * fix: format * fix: regexp * fix: test error * fix: nocobase.conf * fix: path * fix: nocobase.conf * fix: bugs * fix: resourcer prefix * fix: cas
12 lines
322 B
TypeScript
12 lines
322 B
TypeScript
const getSubAppName = (publicPath = '/') => {
|
|
const prefix = `${publicPath}apps/`;
|
|
if (!window.location.pathname.startsWith(prefix)) {
|
|
return;
|
|
}
|
|
const pathname = window.location.pathname.substring(prefix.length);
|
|
const args = pathname.split('/', 1);
|
|
return args[0] || '';
|
|
};
|
|
|
|
export default getSubAppName;
|