Преглед изворни кода

Added GET paramter and hash passthrough in login interface

Toby Chui пре 3 година
родитељ
комит
0072831924
4 измењених фајлова са 7 додато и 6 уклоњено
  1. 1 1
      main.router.go
  2. 1 3
      mod/disk/sortfile/sortfile.go
  3. 1 1
      web/SystemAO/file_system/file_operation.html
  4. 4 1
      web/login.system

+ 1 - 1
main.router.go

@@ -161,7 +161,7 @@ func mrouter(h http.Handler) http.Handler {
 				//Other paths
 				//Rediect to login page
 				w.Header().Set("Cache-Control", "no-cache, no-store, no-transform, must-revalidate, private, max-age=0")
-				http.Redirect(w, r, common.ConstructRelativePathFromRequestURL(r.RequestURI, "login.system")+"?redirect="+r.URL.Path, 307)
+				http.Redirect(w, r, common.ConstructRelativePathFromRequestURL(r.RequestURI, "login.system")+"?redirect="+r.URL.String(), 307)
 			}
 
 		}

+ 1 - 3
mod/disk/sortfile/sortfile.go

@@ -4,12 +4,10 @@ import (
 	"encoding/json"
 	"errors"
 	"net/http"
-	"strconv"
-
-	//"log"
 	"os"
 	"path/filepath"
 	"sort"
+	"strconv"
 
 	user "imuslab.com/arozos/mod/user"
 )

+ 1 - 1
web/SystemAO/file_system/file_operation.html

@@ -686,7 +686,7 @@
                         
                     }else if (opr == "zipAndDown"){
                         //Download
-
+                        
                     }else if (opr == "unzipAndOpen"){
                         //Unzip and open the target directory
                         setTimeout(function(){

+ 4 - 1
web/login.system

@@ -278,10 +278,13 @@
                     window.location.href = data.redirect;
                 }else{
                     //Login succeed
-                    if (redirectionAddress == ""){
+                    if (redirectionAddress == "" || redirectionAddress == "/"){
                         //Redirect back to index
                         window.location.href = "./";
                     }else{
+                        if (window.location.hash.length > 0){
+                            redirectionAddress += window.location.hash
+                        }
                         window.location.href = redirectionAddress;
                     }
                 }