diff --git a/lib/interface.ts b/lib/interface.ts index 3fa8ee7..f021ca9 100644 --- a/lib/interface.ts +++ b/lib/interface.ts @@ -15,10 +15,12 @@ export let InfoCrudMixin = { paranoid: true, getterMethods: { createTime() { - return new Date().getTime(); + // @ts-ignore + return new Date(this.getDataValue('create_time')).getTime(); }, updateTime() { - return new Date().getTime(); + // @ts-ignore + return new Date(this.getDataValue('update_time')).getTime(); } } } @@ -101,10 +103,12 @@ export let UserInterface = { return this.getDataValue('active') === UserActive.ACTIVE; }, createTime() { - return new Date().getTime(); + // @ts-ignore + return new Date(this.getDataValue('create_time')).getTime(); }, updateTime() { - return new Date().getTime(); + // @ts-ignore + return new Date(this.getDataValue('update_time')).getTime(); } } } @@ -202,7 +206,8 @@ export let LogInterface = { updatedAt: false, getterMethods: { time() { - return new Date().getTime(); + // @ts-ignore + return new Date(this.getDataValue('time')).getTime(); } } } diff --git a/package.json b/package.json index f11423e..2098202 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lin-mizar", - "version": "0.2.1", + "version": "0.2.2", "description": "The core library of Lin CMS", "main": "lin/index.js", "scripts": {