Merge pull request #19 from IceWhaleTech/v0.2.1

update ui
This commit is contained in:
link 2021-11-04 03:04:37 -05:00 committed by GitHub
commit 120fb2cea2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 28 additions and 11 deletions

2
UI

@ -1 +1 @@
Subproject commit 235ed7f135f2caf88dc367bf5f7729c6d9b2da92
Subproject commit 11d304e96ddcd9fedea690ab3c8f7750b0ea8a41

View file

@ -1,7 +1,10 @@
package route
import (
"fmt"
"net/http"
"net/http/httputil"
"net/url"
"github.com/IceWhaleTech/CasaOS/middleware"
"github.com/IceWhaleTech/CasaOS/pkg/config"
@ -37,6 +40,20 @@ func InitRouter() *gin.Engine {
r.POST("/v1/user/setusernamepwd", v1.Set_Name_Pwd)
//get user info
r.GET("/v1/user/info", v1.UserInfo)
r.GET("/syncthing/*url", func(c *gin.Context) {
ur := c.Param("url")
fmt.Println(ur)
target := "http://localhost:8384" //最终要访问的服务
remote, err := url.Parse(target)
if err != nil {
fmt.Println(err)
}
proxy := httputil.NewSingleHostReverseProxy(remote)
c.Request.URL.Path = "/" + ur //请求API
proxy.ServeHTTP(c.Writer, c.Request)
})
v1Group := r.Group("/v1")
v1Group.Use(jwt2.JWT(swagHandler))

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -2,5 +2,5 @@ package web
import "embed"
//go:embed index.html favicon.ico img js browserconfig.xml site.webmanifest
//go:embed index.html favicon.svg img js browserconfig.xml site.webmanifest
var Static embed.FS