liuxiran commented on a change in pull request #1284:
URL: https://github.com/apache/apisix-dashboard/pull/1284#discussion_r556413992
##########
File path: web/src/pages/Setting/Setting.tsx
##########
@@ -62,7 +62,15 @@ const Setting: React.FC = () => {
});
setTimeout(() => {
const redirect = getUrlQuery('redirect');
- window.location.href = redirect ? decodeURIComponent(redirect) : '/';
+ const currentHost = window.location.host;
+ if (redirect) {
+ const redirectUrl = decodeURIComponent(redirect);
+ const redirectHost = redirectUrl.split('/')[2];
+ if (currentHost === redirectHost) {
+ window.location.href = redirectUrl;
Review comment:
> I studied the source code and understood that `history.push()` is done
via importing history from umi. I referred the [umi documentation on
`history.push()`](https://umijs.org/api#history).
>
> So, in line 70, can we try to replace the code like below:
> `history.push(redirectUrl);`
you would better only pass the path in the `redirecrUrl` to the
`history.push()`
so you have to:
1. extract the `path` form `redirecrUrl`
2. replace the code in line 70 to `history.push(path);`
just try it ^_^ @ThanoshanMV
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]