From 4636c8a6990f67dcb504fff51a06b67891a59cb5 Mon Sep 17 00:00:00 2001 From: vanoneang <525650856@qq.com> Date: Tue, 12 Nov 2019 17:53:31 +0800 Subject: [PATCH 1/2] fix: get database time --- lib/interface.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) 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(); } } } From 7d20e0a9d5c19a1ccb542620a210b9d883729488 Mon Sep 17 00:00:00 2001 From: Evan Wang <525650856@qq.com> Date: Tue, 12 Nov 2019 17:54:34 +0800 Subject: [PATCH 2/2] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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": {