diff --git a/src/contexts/web/web.go b/src/contexts/web/web.go index 6b097d2c..ad3d6e0c 100644 --- a/src/contexts/web/web.go +++ b/src/contexts/web/web.go @@ -557,7 +557,7 @@ var Index = &ctx.Context{Name: "web", Help: "应用中心", case "cache": m.Echo(msg.Cap(m.Option("name"))) case "config": - if m.Options("value") { + if m.Has("value") { m.Echo(msg.Conf(m.Option("name"), m.Option("value"))) } else { m.Echo(msg.Conf(m.Option("name"))) diff --git a/usr/library/context.js b/usr/library/context.js index c1b1d8ad..e5541940 100644 --- a/usr/library/context.js +++ b/usr/library/context.js @@ -102,10 +102,10 @@ ctx = { typeof cb == "function" && cb(value); }); },//}}} - Conf: function(conf, value, cb) {//{{{ - if (typeof conf == "function") { - value = conf; - conf = undefined; + Conf: function(name, value, cb) {//{{{ + if (typeof name == "function") { + value = name; + name = undefined; } if (typeof value == "function") { cb = value; diff --git a/usr/template/travel.html b/usr/template/travel.html index a6b441fd..b66bb94d 100644 --- a/usr/template/travel.html +++ b/usr/template/travel.html @@ -42,25 +42,41 @@ {{end}} {{define "cache"}} +{{$meta := .}}
+ {{end}} {{define "config"}} @@ -74,10 +90,9 @@ {{range $i, $k := index . $first}}{{index $meta $key $i}}
+