Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
A
accord-with-name
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
malin
accord-with-name
Commits
9275edfe
Commit
9275edfe
authored
Sep 07, 2022
by
lijin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化姓名测算
parent
40e7e2ae
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
83 additions
and
0 deletions
+83
-0
report.js
src/utils/report.js
+83
-0
No files found.
src/utils/report.js
0 → 100644
View file @
9275edfe
var
logBaseUrl
=
'https://report.zhangxinhulian.com'
;
// 页面加载的时候调用
import
$
from
'jquery'
;
export
function
reportEvent
(
action
,
value
,
nodeId
,
ext
)
{
let
cid
=
getCookie
(
'cid'
)
||
''
if
(
cid
==
''
)
{
cid
=
genCid
()
setCookie
(
'cid'
,
cid
,
30
*
24
,
""
)
}
var
clickajaxData
=
{
url
:
window
.
location
.
href
,
action
:
action
,
value
:
value
,
nodeId
:
nodeId
,
ext
:
ext
,
refer
:
document
.
referrer
,
user_agent
:
navigator
.
userAgent
,
platform
:
navigator
.
platform
,
avail_height
:
window
.
screen
.
availHeight
,
avail_width
:
window
.
screen
.
availWidth
,
height
:
window
.
screen
.
height
,
width
:
window
.
screen
.
width
,
color_depth
:
window
.
screen
.
colorDepth
,
pixel_depth
:
window
.
screen
.
pixelDepth
};
$
.
ajax
({
type
:
"POST"
,
url
:
logBaseUrl
+
"/logCollection/log/v1/userLogCollection?module=web&cid="
+
cid
,
async
:
true
,
xhrFields
:
{
withCredentials
:
true
},
crossDomain
:
true
,
dataType
:
"json"
,
contentType
:
"application/json;charset=utf-8"
,
data
:
JSON
.
stringify
(
clickajaxData
),
success
:
function
(
datas
)
{
}
});
}
function
bin2hex
(
s
)
{
var
i
,
l
,
o
=
""
,
n
;
s
+=
""
;
for
(
i
=
0
,
l
=
s
.
length
;
i
<
l
;
i
++
)
{
n
=
s
.
charCodeAt
(
i
).
toString
(
16
);
o
+=
n
.
length
<
2
?
"0"
+
n
:
n
;
}
return
o
;
}
function
genCid
()
{
return
'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'
.
replace
(
/
[
xy
]
/g
,
function
(
c
)
{
var
r
=
Math
.
random
()
*
16
|
0
,
v
=
c
==
'x'
?
r
:
(
r
&
0x3
|
0x8
);
return
v
.
toString
(
16
);
});
}
function
getCookie
(
name
)
{
var
arr
,
reg
=
new
RegExp
(
"(^| )"
+
name
+
"=([^;]*)(;|$)"
);
if
((
arr
=
document
.
cookie
.
match
(
reg
)))
return
unescape
(
arr
[
2
]);
else
return
null
;
}
function
setCookie
(
name
,
value
,
hours
,
path
)
{
name
=
escape
(
name
);
value
=
escape
(
value
);
let
expires
=
new
Date
();
expires
.
setTime
(
expires
.
getTime
()
+
hours
*
3600000
);
path
=
path
==
""
?
""
:
";path="
+
path
;
let
_expires
=
(
typeof
hours
)
==
"string"
?
""
:
";expires="
+
expires
.
toUTCString
();
document
.
cookie
=
name
+
"="
+
value
+
_expires
+
path
;
}
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