cgserver 10.0.4 → 10.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -42,7 +42,7 @@ class MongoBaseService {
42
42
  * @param id
43
43
  */
44
44
  async getById(id) {
45
- let rs = await this.mongoDb.findOne(this._table, null, { id: id });
45
+ let rs = await this.mongoDb.findOne(this._table, { id: id });
46
46
  return rs.one;
47
47
  }
48
48
  async get(where = null, property = null) {
@@ -86,7 +86,7 @@ class MongoAccountService extends MongoBaseService_1.MongoBaseService {
86
86
  * @param openid
87
87
  */
88
88
  async getByThird(unionid, openid) {
89
- let am = await this.get(null, { unionid: unionid, openid: openid });
89
+ let am = await this.get({ unionid: unionid, openid: openid });
90
90
  return am;
91
91
  }
92
92
  /**
@@ -94,11 +94,11 @@ class MongoAccountService extends MongoBaseService_1.MongoBaseService {
94
94
  * @param unionid
95
95
  */
96
96
  async getByUnionid(unionid) {
97
- let am = await this.get(null, { unionid: unionid });
97
+ let am = await this.get({ unionid: unionid });
98
98
  return am;
99
99
  }
100
100
  async getByPhone(phone) {
101
- let am = await this.get(null, { phone: phone + "" });
101
+ let am = await this.get({ phone: phone + "" });
102
102
  return am;
103
103
  }
104
104
  /**
@@ -229,7 +229,7 @@ class MongoAccountService extends MongoBaseService_1.MongoBaseService {
229
229
  }
230
230
  account.login_time = Date.now();
231
231
  account.login_ip = ip;
232
- this.updateOne({ login_time: account.login_time, login_ip: account.login_ip }, { id: account.id });
232
+ this.updateOne({ id: account.id }, { login_time: account.login_time, login_ip: account.login_ip });
233
233
  rs.account = account;
234
234
  return rs;
235
235
  }
@@ -138,7 +138,7 @@ class MongoBaseUserController extends BaseController_1.BaseController {
138
138
  cm.key = this._session_id;
139
139
  cm.data = user.id;
140
140
  cm.expireAt = Date.now() + time * 1000;
141
- MongoCacheService_1.gMongoCacheSer.updateOne(cm, { key: cm.key }, true);
141
+ MongoCacheService_1.gMongoCacheSer.updateOne({ key: cm.key }, cm, true);
142
142
  }
143
143
  this._self_user = user;
144
144
  }
@@ -138,7 +138,7 @@ class MysqlBaseUserController extends BaseController_1.BaseController {
138
138
  cm.key = this._session_id;
139
139
  cm.data = user.id;
140
140
  cm.expireAt = Date.now() + time * 1000;
141
- MongoCacheService_1.gMongoCacheSer.updateOne(cm, { key: cm.key }, true);
141
+ MongoCacheService_1.gMongoCacheSer.updateOne({ key: cm.key }, cm, true);
142
142
  }
143
143
  this._self_user = user;
144
144
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cgserver",
3
- "version": "10.0.4",
3
+ "version": "10.0.5",
4
4
  "author": "trojan",
5
5
  "type": "commonjs",
6
6
  "description": "free for all.Websocket or Http",