2020-07-22 22:19:39 +08:00
|
|
|
package dashboard
|
|
|
|
|
|
2020-12-02 23:47:50 +08:00
|
|
|
import (
|
|
|
|
|
"github.com/TeaOSLab/EdgeAdmin/internal/configloaders"
|
|
|
|
|
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
|
|
|
|
)
|
2020-07-22 22:19:39 +08:00
|
|
|
|
|
|
|
|
type IndexAction struct {
|
|
|
|
|
actionutils.ParentAction
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (this *IndexAction) Init() {
|
|
|
|
|
this.Nav("", "", "")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (this *IndexAction) RunGet(params struct{}) {
|
2020-12-02 23:47:50 +08:00
|
|
|
// 取得用户的权限
|
|
|
|
|
module, ok := configloaders.FindFirstAdminModule(this.AdminId())
|
|
|
|
|
if ok {
|
|
|
|
|
for _, m := range configloaders.AllModuleMaps() {
|
|
|
|
|
if m.GetString("code") == module {
|
|
|
|
|
this.RedirectURL(m.GetString("url"))
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-12-03 11:03:12 +08:00
|
|
|
|
|
|
|
|
this.Show()
|
2020-07-22 22:19:39 +08:00
|
|
|
}
|