feat: fix crash bug in getSteps()

This commit is contained in:
Yang Luo 2023-08-27 21:58:58 +08:00
parent b19be2df88
commit 7e349c1768

View File

@ -218,6 +218,12 @@ export function getNextButtonChild(nextPathName) {
: "Finish"; : "Finish";
} }
export function getSteps(pathName = window.location.pathname) { export function getSteps() {
return TourObj[(pathName.replace("/", ""))]; const path = window.location.pathname.replace("/", "");
const res = TourObj[path];
if (res === undefined) {
return [];
} else {
return res;
}
} }