(
tokenType: number, expireSeconds: number, data: any,
)
| 77 | } |
| 78 | |
| 79 | static async createOrUpdate( |
| 80 | tokenType: number, expireSeconds: number, data: any, |
| 81 | ): Promise<string> { |
| 82 | const d = await TokenModel.coll.findOne({ tokenType, ...data }); |
| 83 | if (!d) { |
| 84 | const res = await TokenModel.add(tokenType, expireSeconds, data); |
| 85 | return res[0]; |
| 86 | } |
| 87 | await TokenModel.update(d._id, tokenType, expireSeconds, data); |
| 88 | return d._id; |
| 89 | } |
| 90 | |
| 91 | @ArgMethod |
| 92 | static getSessionListByUid(uid: number) { |