1.4.5.2
This commit is contained in:
34
EdgeUser/internal/web/actions/default/ui/init.go
Normal file
34
EdgeUser/internal/web/actions/default/ui/init.go
Normal file
@@ -0,0 +1,34 @@
|
||||
package ui
|
||||
|
||||
import (
|
||||
"compress/gzip"
|
||||
"github.com/iwind/TeaGo"
|
||||
"github.com/iwind/TeaGo/Tea"
|
||||
"github.com/iwind/TeaGo/actions"
|
||||
)
|
||||
|
||||
func init() {
|
||||
TeaGo.BeforeStart(func(server *TeaGo.Server) {
|
||||
server.
|
||||
Prefix("/ui").
|
||||
|
||||
// 公共可以访问的链接
|
||||
Get("/image/:fileId", new(ImageAction)).
|
||||
|
||||
// 以下需要登录
|
||||
Get("/download", new(DownloadAction)).
|
||||
Post("/providerOptions", new(ProviderOptionsAction)).
|
||||
Post("/countryOptions", new(CountryOptionsAction)).
|
||||
Post("/provinceOptions", new(ProvinceOptionsAction)).
|
||||
Post("/cityOptions", new(CityOptionsAction)).
|
||||
EndAll()
|
||||
|
||||
// 开发环境下总是动态加载,以便于调试
|
||||
if Tea.IsTesting() {
|
||||
server.
|
||||
Helper(&actions.Gzip{Level: gzip.BestCompression}).
|
||||
Get("/js/components.js", new(ComponentsAction)).
|
||||
EndAll()
|
||||
}
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user