Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
foreign
/
customer-service
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
5e7bd01c
authored
Jan 21, 2022
by
Sixong.Zhu
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
add
parent
3ef41c2c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
service/monitor.ts
service/monitor.ts
View file @
5e7bd01c
import
Axios
,
{
AxiosResponse
,
AxiosAdapter
}
from
"axios"
;
import
Axios
,
{
AxiosResponse
,
AxiosAdapter
}
from
"axios"
;
import
{
UniplatSdk
}
from
"uniplat-sdk"
;
import
{
UniplatSdk
}
from
"uniplat-sdk"
;
import
{
ImEnvironment
}
from
"../model"
;
import
{
ImEnvironment
}
from
"../model"
;
import
{
devAppTools
}
from
'../database/dev-tools'
;
export
const
enum
Product
{
export
const
enum
Product
{
Default
=
"default"
,
Default
=
"default"
,
...
@@ -143,6 +144,27 @@ class WebMonitor {
...
@@ -143,6 +144,27 @@ class WebMonitor {
}
}
}
}
);
);
this
.
auditorLogin
(
sdk
);
}
private
auditorLogin
(
sdk
:
UniplatSdk
)
{
const
name
=
this
.
key
||
sdk
.
global
.
username
||
sdk
.
global
.
uid
;
const
now
=
new
Date
();
const
ts
=
`login-
${
now
.
getFullYear
()}
-
${
now
.
getMonth
()
+
1
}
-
${
now
.
getDate
()}
`
;
devAppTools
.
getDataByKey
(
ts
).
then
(
r
=>
{
const
execute
=
()
=>
{
devAppTools
.
addData
(
now
.
valueOf
(),
ts
);
this
.
log
(
`用户
${
name
}
在
${
now
.
valueOf
()}
登录过,设备
${
window
.
navigator
.
userAgent
}
`
);
};
if
(
r
)
{
const
v
=
+
r
;
if
(
now
.
valueOf
()
-
v
>
60
*
60
*
1000
)
{
execute
();
}
}
else
{
execute
();
}
})
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment