From 4ad401bafc9d54ee56821239a5cbb842f75420b6 Mon Sep 17 00:00:00 2001 From: hoteas <925970985@qq.com> Date: Mon, 5 Jul 2021 02:20:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=8A=E4=BC=A0=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application.go | 3 +++ code/config.go | 1 + db/hotimedb.go | 5 +++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/application.go b/application.go index 36e55fe..c391914 100644 --- a/application.go +++ b/application.go @@ -412,6 +412,9 @@ func (that *Application) crossDomain(context *Context) { if context.Config.GetString("crossDomain") != "auto" { header.Set("Access-Control-Allow-Origin", that.Config.GetString("crossDomain")) + // 后端设置,2592000单位秒,这里是30天 + header.Set("Access-Control-Max-Age", "2592000") + return } diff --git a/code/config.go b/code/config.go index f461426..2ffc727 100644 --- a/code/config.go +++ b/code/config.go @@ -69,6 +69,7 @@ var ColumnNameType = []ColumnShow{ {"index", false, false, false, false, "", false}, {"password", false, true, false, false, "password", false}, + {"pwd", false, true, false, false, "password", false}, {"info", false, true, true, false, "", false}, {"version", false, false, false, false, "", false}, {"seq", false, true, true, false, "", false}, diff --git a/db/hotimedb.go b/db/hotimedb.go index 0b1b8f0..902ff27 100644 --- a/db/hotimedb.go +++ b/db/hotimedb.go @@ -1013,8 +1013,9 @@ func (that *HoTimeDB) Insert(table string, data map[string]interface{}) int64 { id := int64(0) if err.GetError() == nil && res != nil { - //id, that.LastErr.err = res.LastInsertId() - + id1, err := res.LastInsertId() + that.LastErr.SetError(err) + id = id1 } //如果插入成功,删除缓存