From 1613c2839e2532220916f3ba8729082d69d33930 Mon Sep 17 00:00:00 2001 From: w-mj Date: Sat, 11 Mar 2023 20:23:42 +0800 Subject: [PATCH] separate frontend --- Makefile | 2 +- install.yaml | 2 +- main.go | 15 +++++++-------- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 104cff8..707638e 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -IMAGE_TAG ?= docker.educg.net/cg/k8s-manager:v1.1.1 +IMAGE_TAG ?= docker.educg.net/cg/k8s-manager:v1.1.2 build: export CGO_ENABLED=0 build: export GOOS=linux diff --git a/install.yaml b/install.yaml index 911b9e0..ed411af 100644 --- a/install.yaml +++ b/install.yaml @@ -17,7 +17,7 @@ spec: serviceAccountName: dev containers: - name: k8s-manager-pod - image: docker.educg.net/cg/k8s-manager:v1.0.4 + image: docker.educg.net/cg/k8s-manager:v1.1.2 ports: - containerPort: 8080 env: diff --git a/main.go b/main.go index bb6a127..f6d16ea 100644 --- a/main.go +++ b/main.go @@ -14,7 +14,6 @@ import ( "io/fs" m "k8s-manager/src" "net/http" - "os" "strings" ) @@ -164,13 +163,13 @@ func Login(c *gin.Context, username string) { c.SetCookie("Authorization", "Bearer "+token, 0, "", "", false, false) c.Header("Authorization", "Bearer "+token) c.Header("Cache-Control", "no-store") - redirectUrl := "" - if os.Getenv("URL_PREFIX") == "" { - redirectUrl = "/index" - } else { - redirectUrl = fmt.Sprintf("/%s/index", os.Getenv("URL_PREFIX")) - } - c.Redirect(http.StatusTemporaryRedirect, redirectUrl) + //redirectUrl := "" + //if os.Getenv("URL_PREFIX") == "" { + // redirectUrl = "/index" + //} else { + // redirectUrl = fmt.Sprintf("/%s/index", os.Getenv("URL_PREFIX")) + //} + c.Redirect(http.StatusTemporaryRedirect, "/admin-page") } func TestToken(c *gin.Context) {