mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 17:46:28 +08:00
注册功能
This commit is contained in:
1 parent
f259106aa3
commit
6e28dd868e
8 files changed
+55
-39
No files matched your search
@@ -11,7 +11,7 @@ module.exports = {
|
||||
* @param {number} tokenType type of the token.
|
||||
* @param {number} expireSeconds expire time, in seconds.
|
||||
* @param {object} data extra data.
|
||||
* @returns {string} token ID
|
||||
* @returns {Array} token ID, token data
|
||||
*/
|
||||
async add(tokenType, expireSeconds, data) {
|
||||
let now = new Date();
|
||||
@@ -62,7 +62,7 @@ module.exports = {
|
||||
* @returns {boolean} true if deleted, or false.
|
||||
*/
|
||||
async delete(tokenId, tokenType) {
|
||||
let result = await coll.delete_one({ _id: tokenId, tokenType });
|
||||
let result = await coll.deleteOne({ _id: tokenId, tokenType });
|
||||
return !!result.deletedCount;
|
||||
},
|
||||
|
||||
|
||||
Reference in new issue
Block a user