36 lines
843 B
Go
36 lines
843 B
Go
package settingutils
|
|
|
|
import (
|
|
"github.com/TeaOSLab/EdgeUser/internal/web/actions/actionutils"
|
|
"github.com/iwind/TeaGo/actions"
|
|
)
|
|
|
|
type Helper struct {
|
|
tab string
|
|
}
|
|
|
|
func NewHelper(tab string) *Helper {
|
|
return &Helper{
|
|
tab: tab,
|
|
}
|
|
}
|
|
|
|
func (this *Helper) BeforeAction(actionPtr actions.ActionWrapper) (goNext bool) {
|
|
goNext = true
|
|
|
|
var action = actionPtr.Object()
|
|
|
|
// 左侧菜单
|
|
action.Data["teaMenu"] = "settings"
|
|
|
|
// 标签栏
|
|
tabbar := actionutils.NewTabbar()
|
|
tabbar.Add("个人资料", "", "/settings/profile", "", this.tab == "profile")
|
|
tabbar.Add("实名认证", "", "/settings/identity", "", this.tab == "identity")
|
|
tabbar.Add("多因子认证", "", "/settings/mfa", "", this.tab == "mfa")
|
|
tabbar.Add("登录设置", "", "/settings/login", "", this.tab == "login")
|
|
actionutils.SetTabbar(actionPtr, tabbar)
|
|
|
|
return
|
|
}
|