@tomei/sso 0.60.4-dev.4 → 0.60.4-dev.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/components/login-history/index.d.ts +1 -1
- package/dist/src/components/login-history/index.js +1 -1
- package/dist/src/components/login-history/index.js.map +1 -1
- package/dist/src/components/login-history/login-history.d.ts +1 -0
- package/dist/src/components/login-history/login-history.js +13 -4
- package/dist/src/components/login-history/login-history.js.map +1 -1
- package/dist/src/interfaces/login-history.interface.d.ts +3 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/components/login-history/index.ts +1 -1
- package/src/components/login-history/login-history.ts +13 -3
- package/src/interfaces/login-history.interface.ts +3 -0
package/package.json
CHANGED
@@ -5,6 +5,7 @@ import { LoginUser } from '../login-user/login-user';
|
|
5
5
|
import { ApplicationConfig } from '@tomei/config';
|
6
6
|
import { ILoginHistorySearchAttr } from '../../interfaces/login-history-search-attr.interface';
|
7
7
|
import { Op } from 'sequelize';
|
8
|
+
import User from '../../models/user.entity';
|
8
9
|
|
9
10
|
export class LoginHistory extends ObjectBase {
|
10
11
|
ObjectId: string;
|
@@ -14,6 +15,7 @@ export class LoginHistory extends ObjectBase {
|
|
14
15
|
|
15
16
|
HistoryId: number;
|
16
17
|
UserId: number;
|
18
|
+
UserName: string;
|
17
19
|
OriginIP: string;
|
18
20
|
SystemCode: string;
|
19
21
|
LoginStatus: string;
|
@@ -27,12 +29,13 @@ export class LoginHistory extends ObjectBase {
|
|
27
29
|
private constructor(loginHistoryAttr?: ILoginHistoryAttr) {
|
28
30
|
super();
|
29
31
|
if (loginHistoryAttr) {
|
30
|
-
this.HistoryId = loginHistoryAttr
|
31
|
-
this.UserId = loginHistoryAttr
|
32
|
+
this.HistoryId = loginHistoryAttr?.HistoryId;
|
33
|
+
this.UserId = loginHistoryAttr?.UserId;
|
34
|
+
this.UserName = loginHistoryAttr?.User?.UserName;
|
32
35
|
this.OriginIP = loginHistoryAttr?.OriginIp;
|
33
36
|
this.SystemCode = loginHistoryAttr?.SystemCode;
|
34
37
|
this.LoginStatus = loginHistoryAttr?.LoginStatus;
|
35
|
-
this._CreatedAt = loginHistoryAttr
|
38
|
+
this._CreatedAt = loginHistoryAttr?.CreatedAt;
|
36
39
|
}
|
37
40
|
}
|
38
41
|
|
@@ -96,6 +99,13 @@ export class LoginHistory extends ObjectBase {
|
|
96
99
|
where: queryObj,
|
97
100
|
...whereObj,
|
98
101
|
order: [['CreatedAt', 'DESC']],
|
102
|
+
include: [
|
103
|
+
{
|
104
|
+
model: User,
|
105
|
+
required: false,
|
106
|
+
attributes: ['UserName'],
|
107
|
+
},
|
108
|
+
],
|
99
109
|
transaction: dbTransaction,
|
100
110
|
});
|
101
111
|
|