1
0
mirror of https://shylinux.com/x/ContextOS synced 2025-04-25 16:58:06 +08:00

fix cookie bug

This commit is contained in:
shylinux 2018-11-14 02:00:26 +08:00
parent 9b3fa9020c
commit 121f016ebd
4 changed files with 5 additions and 9 deletions

View File

@ -8,7 +8,7 @@ install:
@go get github.com/gomarkdown/markdown @go get github.com/gomarkdown/markdown
go install $(BENCH) go install $(BENCH)
@date @date
bench web.code.counter nmake 1 # bench web.code.counter nmake 1
install_all: install install_all: install
touch etc/local.shy touch etc/local.shy

View File

@ -19,8 +19,8 @@ func sysinfo(m *ctx.Message, c *ctx.Context, key string, arg ...string) {
m.Append("uptime", d) m.Append("uptime", d)
m.Append("procs", sys.Procs) m.Append("procs", sys.Procs)
m.Append("total", kit.FmtSize(sys.Totalram)) m.Append("total", kit.FmtSize(uint64(sys.Totalram)))
m.Append("free", kit.FmtSize(sys.Freeram)) m.Append("free", kit.FmtSize(uint64(sys.Freeram)))
m.Append("mper", fmt.Sprintf("%d%%", sys.Freeram*100/sys.Totalram)) m.Append("mper", fmt.Sprintf("%d%%", sys.Freeram*100/sys.Totalram))
fs := &syscall.Statfs_t{} fs := &syscall.Statfs_t{}

View File

@ -725,7 +725,7 @@ var Index = &ctx.Context{Name: "web", Help: "应用中心",
login = m.Spawn().Cmd("session").Appendv("login").(*ctx.Message) login = m.Spawn().Cmd("session").Appendv("login").(*ctx.Message)
} }
if login != nil { if login != nil {
http.SetCookie(w, &http.Cookie{Name: "sessid", Value: login.Cap("sessid")}) http.SetCookie(w, &http.Cookie{Name: "sessid", Value: login.Cap("sessid"), Path: "/"})
} }
if !right && login != nil { if !right && login != nil {

View File

@ -108,11 +108,7 @@ function onaction(event, action) {
} }
break break
case "command": case "command":
send_command(event.target.form, function() { send_command(event.target.form, function() {})
if (event.target.value == "login") {
location.reload()
}
})
break break
case "input": case "input":
switch (event.key) { switch (event.key) {