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
|
|
|
|
2021-02-25 20:54:30 +08:00
|
|
|
// 公共可以访问的链接
|
|
|
|
|
Get("/image/:fileId", new(ImageAction)).
|
|
|
|
|
|
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)).
|
2021-02-06 17:37:09 +08:00
|
|
|
Post("/eventLevelOptions", new(EventLevelOptionsAction)).
|
2020-12-03 11:03:12 +08:00
|
|
|
|
2020-07-22 22:19:39 +08:00
|
|
|
EndAll()
|
|
|
|
|
})
|
|
|
|
|
}
|