index.go 436 B

12345678910111213141516171819202122232425
  1. package web
  2. import (
  3. "Gwen/global"
  4. "github.com/gin-gonic/gin"
  5. )
  6. type Index struct {
  7. }
  8. func (i *Index) Index(c *gin.Context) {
  9. c.Redirect(302, "/_admin/")
  10. }
  11. func (i *Index) ConfigJs(c *gin.Context) {
  12. apiServer := global.Config.Rustdesk.ApiServer
  13. tmp := `
  14. localStorage.setItem('api-server', "` + apiServer + `")
  15. const ws2_prefix = 'wc-'
  16. localStorage.setItem(ws2_prefix+'api-server', "` + apiServer + `")
  17. `
  18. c.String(200, tmp)
  19. }