mirror of
https://github.com/quarkcloudio/quark-go.git
synced 2025-09-26 20:11:11 +08:00
fix: 调整说明文件
This commit is contained in:
@@ -68,7 +68,7 @@ func main() {
|
||||
|
||||
## 相关项目
|
||||
- [QuarkSmart](https://github.com/quarkcms/quark-smart) 单体应用
|
||||
- [QuarkMicro](https://github.com/quarkcms/quark-go) 微服务应用(开发中)
|
||||
- [QuarkMicro](https://github.com/quarkcms/quark-go) 微服务应用
|
||||
|
||||
## 演示站点
|
||||
香港站点,页面加载可能比较缓慢
|
||||
|
@@ -4,10 +4,7 @@ import (
|
||||
"net/http"
|
||||
"reflect"
|
||||
|
||||
"github.com/quarkcms/quark-go/pkg/app/model"
|
||||
"github.com/quarkcms/quark-go/pkg/builder"
|
||||
"github.com/quarkcms/quark-go/pkg/component/admin/footer"
|
||||
"github.com/quarkcms/quark-go/pkg/component/admin/layout"
|
||||
"github.com/quarkcms/quark-go/pkg/component/admin/page"
|
||||
"github.com/quarkcms/quark-go/pkg/component/admin/pagecontainer"
|
||||
"github.com/quarkcms/quark-go/pkg/msg"
|
||||
@@ -110,55 +107,6 @@ func (p *MixTemplate) PageComponentRender(ctx *builder.Context, body interface{}
|
||||
JsonSerialize()
|
||||
}
|
||||
|
||||
// 页面布局组件渲染
|
||||
func (p *MixTemplate) LayoutComponentRender(ctx *builder.Context, body interface{}) interface{} {
|
||||
admin := &model.Admin{}
|
||||
config := ctx.Engine.GetConfig()
|
||||
|
||||
// 获取登录管理员信息
|
||||
adminInfo, err := admin.GetAuthUser(config.AppKey, ctx.Token())
|
||||
if err != nil {
|
||||
return msg.Error(err.Error(), "")
|
||||
}
|
||||
|
||||
// 获取管理员菜单
|
||||
getMenus, err := admin.GetMenuListById(adminInfo.Id)
|
||||
if err != nil {
|
||||
return msg.Error(err.Error(), "")
|
||||
}
|
||||
|
||||
adminLayout := ctx.Engine.GetAdminLayout()
|
||||
|
||||
// 页脚
|
||||
footer := (&footer.Component{}).
|
||||
Init().
|
||||
SetCopyright(adminLayout.Copyright).
|
||||
SetLinks(adminLayout.Links)
|
||||
|
||||
// 页面容器组件渲染
|
||||
pageContainerComponent := ctx.Template.(interface {
|
||||
PageContainerComponentRender(ctx *builder.Context, body interface{}) interface{}
|
||||
}).PageContainerComponentRender(ctx, body)
|
||||
|
||||
return (&layout.Component{}).
|
||||
Init().
|
||||
SetTitle(adminLayout.Title).
|
||||
SetLogo(adminLayout.Logo).
|
||||
SetActions(adminLayout.Actions).
|
||||
SetLayout(adminLayout.Layout).
|
||||
SetSplitMenus(adminLayout.SplitMenus).
|
||||
SetContentWidth(adminLayout.ContentWidth).
|
||||
SetPrimaryColor(adminLayout.PrimaryColor).
|
||||
SetFixSiderbar(adminLayout.FixSiderbar).
|
||||
SetFixedHeader(adminLayout.FixedHeader).
|
||||
SetIconfontUrl(adminLayout.IconfontUrl).
|
||||
SetLocale(adminLayout.Locale).
|
||||
SetSiderWidth(adminLayout.SiderWidth).
|
||||
SetMenu(getMenus).
|
||||
SetBody(pageContainerComponent).
|
||||
SetFooter(footer)
|
||||
}
|
||||
|
||||
// 页面容器组件渲染
|
||||
func (p *MixTemplate) PageContainerComponentRender(ctx *builder.Context, body interface{}) interface{} {
|
||||
value := reflect.ValueOf(ctx.Template).Elem()
|
||||
|
Reference in New Issue
Block a user