mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2026-04-27 08:05:28 +08:00
[系统用户]实现基础的权限校验
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
package dashboard
|
||||
|
||||
import "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/configloaders"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
)
|
||||
|
||||
type IndexAction struct {
|
||||
actionutils.ParentAction
|
||||
@@ -11,5 +14,14 @@ func (this *IndexAction) Init() {
|
||||
}
|
||||
|
||||
func (this *IndexAction) RunGet(params struct{}) {
|
||||
this.RedirectURL("/servers")
|
||||
// 取得用户的权限
|
||||
module, ok := configloaders.FindFirstAdminModule(this.AdminId())
|
||||
if ok {
|
||||
for _, m := range configloaders.AllModuleMaps() {
|
||||
if m.GetString("code") == module {
|
||||
this.RedirectURL(m.GetString("url"))
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user