Support send email with ssl

This commit is contained in:
lealife
2016-10-29 16:38:13 +08:00
parent 816af11db2
commit f49624d3eb
5 changed files with 108 additions and 5 deletions

View File

@ -49,7 +49,8 @@ func (this *ConfigService) InitGlobalConfigs() bool {
this.adminUserId = userInfo.UserId.Hex()
configs := []info.Config{}
db.ListByQ(db.Configs, bson.M{"UserId": userInfo.UserId}, &configs)
// db.ListByQ(db.Configs, bson.M{"UserId": userInfo.UserId}, &configs)
db.ListByQ(db.Configs, bson.M{}, &configs)
for _, config := range configs {
if config.IsArr {
@ -96,7 +97,7 @@ func (this *ConfigService) updateGlobalConfig(userId, key string, value interfac
if _, ok := this.GlobalAllConfigs[key]; !ok {
// 需要添加
config := info.Config{ConfigId: bson.NewObjectId(),
UserId: bson.ObjectIdHex(userId),
UserId: bson.ObjectIdHex(userId), // 没用
Key: key,
IsArr: isArr,
IsMap: isMap,
@ -141,7 +142,8 @@ func (this *ConfigService) updateGlobalConfig(userId, key string, value interfac
i["ValueStr"] = v
this.GlobalStringConfigs[key] = v
}
return db.UpdateByQMap(db.Configs, bson.M{"UserId": bson.ObjectIdHex(userId), "Key": key}, i)
// return db.UpdateByQMap(db.Configs, bson.M{"UserId": bson.ObjectIdHex(userId), "Key": key}, i)
return db.UpdateByQMap(db.Configs, bson.M{"Key": key}, i)
}
}