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 } //如果插入成功,删除缓存