separate frontend

This commit is contained in:
w-mj 2023-03-11 20:23:42 +08:00
parent 2cb68861aa
commit 1613c2839e
No known key found for this signature in database
GPG Key ID: 3A2CB5BE2F835897
3 changed files with 9 additions and 10 deletions

View File

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

View File

@ -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:

15
main.go
View File

@ -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) {