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

42 lines
1.2 KiB
Go
Raw Normal View History

2020-07-22 22:19:39 +08:00
package ui
import (
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"
2021-11-22 12:08:53 +08:00
"github.com/iwind/TeaGo/Tea"
2020-07-22 22:19:39 +08:00
)
func init() {
TeaGo.BeforeStart(func(server *TeaGo.Server) {
server.
Prefix("/ui").
2020-10-11 10:51:13 +08:00
// 公共可以访问的链接
Get("/image/:fileId", new(ImageAction)).
2020-12-03 11:03:12 +08:00
// 以下需要登录
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)).
2021-06-23 13:12:33 +08:00
Post("/showTip", new(ShowTipAction)).
Post("/hideTip", new(HideTipAction)).
2021-07-12 10:21:17 +08:00
Post("/theme", new(ThemeAction)).
2021-09-13 10:51:16 +08:00
Post("/validateIPs", new(ValidateIPsAction)).
Post("/providerOptions", new(ProviderOptionsAction)).
Post("/countryOptions", new(CountryOptionsAction)).
Post("/provinceOptions", new(ProvinceOptionsAction)).
Post("/cityOptions", new(CityOptionsAction)).
2020-07-22 22:19:39 +08:00
EndAll()
2021-11-22 12:08:53 +08:00
// 开发环境下总是动态加载,以便于调试
if Tea.IsTesting() {
server.
Get("/js/components.js", new(ComponentsAction)).
EndAll()
}
2020-07-22 22:19:39 +08:00
})
}