ThanoshanMV commented on a change in pull request #1284:
URL: https://github.com/apache/apisix-dashboard/pull/1284#discussion_r556637495



##########
File path: web/src/pages/Setting/Setting.tsx
##########
@@ -62,7 +62,20 @@ 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 pathArray = redirectUrl.split('/');
+            const redirectHost = pathArray[2];
+            if (currentHost === redirectHost) {
+              let path = '';
+              for (let i = 3; i < pathArray.length; i++) {
+                path += '/';
+                path += pathArray[i];
+              }
+              history.push(path);
+            }
+          }

Review comment:
       Okay, I'll commit suggestion




----------------------------------------------------------------
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]


Reply via email to