Files
rustdesk-api/http/controller/web/index.go
2025-02-12 16:07:51 +08:00

28 lines
622 B
Go

package web
import (
"github.com/gin-gonic/gin"
"github.com/lejianwen/rustdesk-api/global"
"strconv"
)
type Index struct {
}
func (i *Index) Index(c *gin.Context) {
c.Redirect(302, "/_admin/")
}
func (i *Index) ConfigJs(c *gin.Context) {
apiServer := global.Config.Rustdesk.ApiServer
magicQueryonline := strconv.Itoa(global.Config.Rustdesk.WebclientMagicQueryonline)
tmp := `
localStorage.setItem('api-server', "` + apiServer + `")
const ws2_prefix = 'wc-'
localStorage.setItem(ws2_prefix+'api-server', "` + apiServer + `")
window.webclient_magic_queryonline = ` + magicQueryonline + ``
c.String(200, tmp)
}