hrp-ui-base 1.3.4 → 1.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -213,7 +213,37 @@ const handleParentClick = (_item: HomeMenu, index: number) => {
|
|
|
213
213
|
};
|
|
214
214
|
|
|
215
215
|
const goHomePage = () => {
|
|
216
|
-
|
|
216
|
+
const subApps = [
|
|
217
|
+
"imd",
|
|
218
|
+
"agoal",
|
|
219
|
+
"scm",
|
|
220
|
+
"bms",
|
|
221
|
+
"coc",
|
|
222
|
+
"hws",
|
|
223
|
+
"fms",
|
|
224
|
+
"hrm",
|
|
225
|
+
"hrms",
|
|
226
|
+
"itrms",
|
|
227
|
+
"personalization",
|
|
228
|
+
"projectManagement",
|
|
229
|
+
];
|
|
230
|
+
const pathname = window.location.pathname;
|
|
231
|
+
// 获取最后一个 / 之间的内容
|
|
232
|
+
const segments = pathname.replace(/\/$/, "").split("/");
|
|
233
|
+
const lastSegment = segments[segments.length - 1];
|
|
234
|
+
|
|
235
|
+
if (subApps.includes(lastSegment)) {
|
|
236
|
+
// 删除最后一个路径段
|
|
237
|
+
segments.pop();
|
|
238
|
+
const basePath = segments.join("/") || "/";
|
|
239
|
+
const targetUrl =
|
|
240
|
+
window.location.origin +
|
|
241
|
+
(basePath.endsWith("/") ? basePath : basePath + "/") +
|
|
242
|
+
"#/application-entry";
|
|
243
|
+
window.location.replace(targetUrl);
|
|
244
|
+
} else {
|
|
245
|
+
router?.replace({ path: options?.entryUrl || "/application-entry" });
|
|
246
|
+
}
|
|
217
247
|
};
|
|
218
248
|
|
|
219
249
|
const handleCollapseChange = (collapsed: boolean) => {
|