mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2026-04-09 00:45:30 +08:00
[系统用户]优化权限设置
This commit is contained in:
@@ -2,7 +2,6 @@ package ui
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/helpers"
|
||||
)
|
||||
|
||||
// 下载指定的文本内容
|
||||
@@ -17,8 +16,6 @@ func (this *DownloadAction) Init() {
|
||||
func (this *DownloadAction) RunGet(params struct {
|
||||
File string
|
||||
Text string
|
||||
|
||||
Auth *helpers.UserMustAuth
|
||||
}) {
|
||||
this.AddHeader("Content-Disposition", "attachment; filename=\""+params.File+"\";")
|
||||
this.WriteString(params.Text)
|
||||
|
||||
@@ -2,6 +2,8 @@ package ui
|
||||
|
||||
import (
|
||||
"compress/gzip"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/configloaders"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/helpers"
|
||||
"github.com/iwind/TeaGo"
|
||||
"github.com/iwind/TeaGo/actions"
|
||||
)
|
||||
@@ -10,13 +12,18 @@ func init() {
|
||||
TeaGo.BeforeStart(func(server *TeaGo.Server) {
|
||||
server.
|
||||
Prefix("/ui").
|
||||
Get("/download", new(DownloadAction)).
|
||||
GetPost("/selectProvincesPopup", new(SelectProvincesPopupAction)).
|
||||
GetPost("/selectCountriesPopup", new(SelectCountriesPopupAction)).
|
||||
|
||||
// 以下的需要压缩
|
||||
Helper(&actions.Gzip{Level: gzip.BestCompression}).
|
||||
Get("/components.js", new(ComponentsAction)).
|
||||
EndHelpers().
|
||||
|
||||
// 以下需要登录
|
||||
Helper(helpers.NewUserMustAuth(configloaders.AdminModuleCodeCommon)).
|
||||
Get("/download", new(DownloadAction)).
|
||||
GetPost("/selectProvincesPopup", new(SelectProvincesPopupAction)).
|
||||
GetPost("/selectCountriesPopup", new(SelectCountriesPopupAction)).
|
||||
|
||||
EndAll()
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user