Files
EdgeAdmin/internal/web/actions/default/ui/init.go

30 lines
751 B
Go
Raw Normal View History

2020-07-22 22:19:39 +08:00
package ui
import (
2020-10-13 20:05:29 +08:00
"compress/gzip"
2020-12-03 11:03:12 +08:00
"github.com/TeaOSLab/EdgeAdmin/internal/configloaders"
"github.com/TeaOSLab/EdgeAdmin/internal/web/helpers"
2020-07-22 22:19:39 +08:00
"github.com/iwind/TeaGo"
"github.com/iwind/TeaGo/actions"
)
func init() {
TeaGo.BeforeStart(func(server *TeaGo.Server) {
server.
Prefix("/ui").
2020-10-11 10:51:13 +08:00
// 以下的需要压缩
2020-10-13 20:05:29 +08:00
Helper(&actions.Gzip{Level: gzip.BestCompression}).
2020-07-22 22:19:39 +08:00
Get("/components.js", new(ComponentsAction)).
2020-12-03 11:03:12 +08:00
EndHelpers().
// 以下需要登录
Helper(helpers.NewUserMustAuth(configloaders.AdminModuleCodeCommon)).
Get("/download", new(DownloadAction)).
GetPost("/selectProvincesPopup", new(SelectProvincesPopupAction)).
GetPost("/selectCountriesPopup", new(SelectCountriesPopupAction)).
2020-07-22 22:19:39 +08:00
EndAll()
})
}