update ui
This commit is contained in:
parent
a6ceee7bc0
commit
37130966cf
5 changed files with 28 additions and 11 deletions
2
UI
2
UI
|
@ -1 +1 @@
|
|||
Subproject commit 235ed7f135f2caf88dc367bf5f7729c6d9b2da92
|
||||
Subproject commit 11d304e96ddcd9fedea690ab3c8f7750b0ea8a41
|
|
@ -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))
|
||||
|
|
16
web/js/2.js
16
web/js/2.js
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue