- -
-
- - - - -
-
- -
-
- - +
+
+
+
Authenticate Required
+
+
+
+ +
-
+
+
+ + +
+
+
+
+ +
+ +
+ +
+
+{% include "layout/footer.html" %} + {% endblock %} \ No newline at end of file diff --git a/asset/template/me.html b/asset/template/me.html new file mode 100755 index 0000000..f582135 --- /dev/null +++ b/asset/template/me.html @@ -0,0 +1,51 @@ +{% extends "layout/base.html" %} + + +{% block body %} +{% include "layout/topnav.html" %} +
+
+
Basic User Profile
+
+
+ +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Uidspi-ca
Name$0.87
Alan$3.76
Lollipop$7.00
+
+ +
+
+ + + +
+{% include "layout/footer.html" %} + +{% endblock %} \ No newline at end of file diff --git a/asset/template/page_404.html b/asset/template/page_404.html index 88de5ea..c8029e8 100755 --- a/asset/template/page_404.html +++ b/asset/template/page_404.html @@ -1,8 +1,8 @@ {% extends "layout/base.html" %} {% block head_add_header %} - - - + + + {% endblock %} {% block body %} diff --git a/main.go b/main.go index f18e05d..815e3ef 100644 --- a/main.go +++ b/main.go @@ -53,8 +53,9 @@ func main() { r.NoRoute(recovery.RecoveryHttpError(http.StatusNotFound)) r.NoMethod(recovery.RecoveryHttpError(http.StatusMethodNotAllowed)) + suburl:="/account" // suburl process - path := r.Group("/") + path := r.Group(suburl) path.Use(recovery.RecoveryHTML()) // handlers api := path.Group("/api") @@ -75,7 +76,10 @@ func main() { })) api.Use(session.Sessions("mnemonics", store)) - api.GET("/auth", route.Me) + + api.GET("/auth", route.Authenticate) + path.GET("/login", route.Login) + path.GET("/me", route.Me) path.GET("/self", route.Self) path.GET("/metric", route.Metric) path.GET("/health", func(c *gin.Context) { @@ -94,7 +98,6 @@ func main() { c.Redirect(http.StatusMovedPermanently, "/static/favicon/browserconfig.xml") }) - path.GET("/login", route.Login) path.GET("/", route.Index) if gin.IsDebugging() { diff --git a/route/api.go b/route/api.go index 06b8354..8a4d598 100644 --- a/route/api.go +++ b/route/api.go @@ -7,7 +7,7 @@ import ( //https://github.com/boombuler/barcode ) -func Me(c *gin.Context) { +func Authenticate(c *gin.Context) { content := gin.H{"Hello": "World"} sess := session.Default(c) @@ -19,9 +19,7 @@ func Me(c *gin.Context) { count = v.(int) count += 1 } - sess.Set("count", count) - sess.Save() - + // util.Log().Errorf(" sess : %d", count) conn := util.NewAccoauntSource() diff --git a/route/auth.go b/route/auth.go index 474bfd5..0d05e96 100644 --- a/route/auth.go +++ b/route/auth.go @@ -11,3 +11,7 @@ import ( func Login(c *gin.Context) { c.HTML(http.StatusOK, "login.html", template.Context{}) } + +func Me(c *gin.Context) { + c.HTML(http.StatusOK, "me.html", template.Context{}) +} diff --git a/util/ldap.go b/util/ldap.go index fb8c442..37803c6 100644 --- a/util/ldap.go +++ b/util/ldap.go @@ -157,8 +157,8 @@ func NewAccoauntSource() AccountSource { filter: "|((objectClass=groupOfNames)(objectClass=groupOfUniqueNames))", uniqueAttributeName: "cn"} return &ldapSource{ - host: "keeper.amuz.es", - port: 636, + host: "127.0.0.1", + port: 6360, user: user, group: group} }