parent
50816c68b0
commit
dda15b0821
3 changed files with 8 additions and 2 deletions
|
@ -24,6 +24,7 @@ import (
|
|||
"github.com/IceWhaleTech/CasaOS/pkg/samba"
|
||||
"github.com/IceWhaleTech/CasaOS/pkg/utils/encryption"
|
||||
"github.com/IceWhaleTech/CasaOS/pkg/utils/file"
|
||||
v1 "github.com/IceWhaleTech/CasaOS/route/v1"
|
||||
"github.com/IceWhaleTech/CasaOS/service"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
@ -31,6 +32,7 @@ import (
|
|||
func InitFunction() {
|
||||
go InitNetworkMount()
|
||||
go InitInfo()
|
||||
go InitZerotier()
|
||||
}
|
||||
|
||||
func InitInfo() {
|
||||
|
@ -98,3 +100,6 @@ func InitNetworkMount() {
|
|||
logger.Error("mount storage err", zap.Any("err", err))
|
||||
}
|
||||
}
|
||||
func InitZerotier() {
|
||||
v1.CheckNetwork()
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ func InitV1Router() *gin.Engine {
|
|||
})
|
||||
r.GET("/v1/recover/:type", v1.GetRecoverStorage)
|
||||
v1Group := r.Group("/v1")
|
||||
r.Any("/v1/test", v1.CheckNetwork)
|
||||
// r.Any("/v1/test", v1.CheckNetwork)
|
||||
v1Group.Use(jwt.ExceptLocalhost(func() (*ecdsa.PublicKey, error) { return external.GetPublicKey(config.CommonInfo.RuntimePath) }))
|
||||
{
|
||||
|
||||
|
|
|
@ -75,7 +75,8 @@ func copyHeaders(destination, source http.Header) {
|
|||
}
|
||||
}
|
||||
|
||||
func CheckNetwork(c *gin.Context) {
|
||||
func CheckNetwork() {
|
||||
|
||||
//先获取所有已创建的网络
|
||||
respBody, err := httper.ZTGet("/controller/network")
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in a new issue