瀏覽代碼

update to v1.2.7

cg33 6 年之前
父節點
當前提交
d8dad971b1
共有 1 個文件被更改,包括 4 次插入5 次删除
  1. 4 5
      main.go

+ 4 - 5
main.go

@@ -1,7 +1,8 @@
 package main
 
 import (
-	_ "github.com/GoAdminGroup/go-admin/adapter/gin"               // adapter
+	_ "github.com/GoAdminGroup/go-admin/adapter/gin" // adapter
+	"github.com/GoAdminGroup/go-admin/context"
 	_ "github.com/GoAdminGroup/go-admin/modules/db/drivers/sqlite" // sql driver
 	_ "github.com/GoAdminGroup/themes/adminlte"                    // theme
 
@@ -75,10 +76,8 @@ func main() {
 	// customize your index pages
 	// 下面这样定制您的首页👇
 
-	r.GET("/admin", func(ctx *gin.Context) {
-		engine.Content(ctx, func(ctx interface{}) (types.Panel, error) {
-			return DashboardPage()
-		})
+	eng.HTML("GET", "/admin", func(ctx *context.Context) (panel types.Panel, e error) {
+		return DashboardPage()
 	})
 
 	_ = r.Run(":9033")