diff --git a/lib/mem-store.js b/lib/mem-store.js index 0dc8f6b..3dec72b 100644 --- a/lib/mem-store.js +++ b/lib/mem-store.js @@ -4,14 +4,7 @@ * @date 2020/09/18 16:35:26 */ -function hideProperty(host, name, value) { - Object.defineProperty(host, name, { - value: value, - writable: true, - enumerable: false, - configurable: true - }) -} +import fs from 'fs' export default class Session { constructor(opt) { @@ -33,7 +26,7 @@ export default class Session { } // 设置session有效期 - hideProperty(session, '__expires__', Date.now() + this.ttl * 1000) + session.__expires__ = Date.now() + this.ttl * 1000 } // 获取session字段值