separate frontend
This commit is contained in:
parent
2cb68861aa
commit
1613c2839e
2
Makefile
2
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 CGO_ENABLED=0
|
||||||
build: export GOOS=linux
|
build: export GOOS=linux
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ spec:
|
||||||
serviceAccountName: dev
|
serviceAccountName: dev
|
||||||
containers:
|
containers:
|
||||||
- name: k8s-manager-pod
|
- 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:
|
ports:
|
||||||
- containerPort: 8080
|
- containerPort: 8080
|
||||||
env:
|
env:
|
||||||
|
|
|
||||||
15
main.go
15
main.go
|
|
@ -14,7 +14,6 @@ import (
|
||||||
"io/fs"
|
"io/fs"
|
||||||
m "k8s-manager/src"
|
m "k8s-manager/src"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -164,13 +163,13 @@ func Login(c *gin.Context, username string) {
|
||||||
c.SetCookie("Authorization", "Bearer "+token, 0, "", "", false, false)
|
c.SetCookie("Authorization", "Bearer "+token, 0, "", "", false, false)
|
||||||
c.Header("Authorization", "Bearer "+token)
|
c.Header("Authorization", "Bearer "+token)
|
||||||
c.Header("Cache-Control", "no-store")
|
c.Header("Cache-Control", "no-store")
|
||||||
redirectUrl := ""
|
//redirectUrl := ""
|
||||||
if os.Getenv("URL_PREFIX") == "" {
|
//if os.Getenv("URL_PREFIX") == "" {
|
||||||
redirectUrl = "/index"
|
// redirectUrl = "/index"
|
||||||
} else {
|
//} else {
|
||||||
redirectUrl = fmt.Sprintf("/%s/index", os.Getenv("URL_PREFIX"))
|
// redirectUrl = fmt.Sprintf("/%s/index", os.Getenv("URL_PREFIX"))
|
||||||
}
|
//}
|
||||||
c.Redirect(http.StatusTemporaryRedirect, redirectUrl)
|
c.Redirect(http.StatusTemporaryRedirect, "/admin-page")
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestToken(c *gin.Context) {
|
func TestToken(c *gin.Context) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue