|
@@ -180,16 +180,33 @@ const submitClick = async () => {
|
|
|
} else {
|
|
} else {
|
|
|
targetPath = hashStr;
|
|
targetPath = hashStr;
|
|
|
}
|
|
}
|
|
|
- } else {
|
|
|
|
|
- const usp = new URLSearchParams(url.search);
|
|
|
|
|
- usp.delete('token');
|
|
|
|
|
- const qs = usp.toString();
|
|
|
|
|
- const pathName = url.pathname;
|
|
|
|
|
- targetPath = qs ? `${pathName}?${qs}` : pathName;
|
|
|
|
|
- }
|
|
|
|
|
- if (!targetPath.startsWith('/')) targetPath = '/' + targetPath;
|
|
|
|
|
- console.log('Internal redirect to', targetPath);
|
|
|
|
|
- router.replace(targetPath);
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // Fallback: when redirect contains '%23' in pathname (encoded '#'), treat as hash route
|
|
|
|
|
+ if (url.pathname.includes('%23')) {
|
|
|
|
|
+ const idx = url.pathname.indexOf('%23');
|
|
|
|
|
+ const after = url.pathname.slice(idx + 3); // content after '%23'
|
|
|
|
|
+ const qIndex = after.indexOf('?');
|
|
|
|
|
+ if (qIndex > -1) {
|
|
|
|
|
+ const basePath = after.slice(0, qIndex);
|
|
|
|
|
+ const queryStr = after.slice(qIndex + 1);
|
|
|
|
|
+ const usp = new URLSearchParams(queryStr);
|
|
|
|
|
+ usp.delete('token');
|
|
|
|
|
+ const qs = usp.toString();
|
|
|
|
|
+ targetPath = qs ? `${basePath}?${qs}` : basePath;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ targetPath = after;
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ const usp = new URLSearchParams(url.search);
|
|
|
|
|
+ usp.delete('token');
|
|
|
|
|
+ const qs = usp.toString();
|
|
|
|
|
+ const pathName = url.pathname;
|
|
|
|
|
+ targetPath = qs ? `${pathName}?${qs}` : pathName;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!targetPath.startsWith('/')) targetPath = '/' + targetPath;
|
|
|
|
|
+ console.log('Internal redirect to', targetPath);
|
|
|
|
|
+ router.replace(targetPath);
|
|
|
} else {
|
|
} else {
|
|
|
url.searchParams.delete("token");
|
|
url.searchParams.delete("token");
|
|
|
console.log('External redirect to', url.toString());
|
|
console.log('External redirect to', url.toString());
|