Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivWeb
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
CivWeb
Commits
7bb5d72d
Commit
7bb5d72d
authored
Dec 01, 2022
by
杨思琦
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 消息自定义模板修改
parent
505cb571
Pipeline
#64789
passed with stages
Changes
7
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
72 additions
and
39 deletions
+72
-39
message.js
src/layouts/AppLayout/notifier/message.js
+12
-0
notice.js
src/layouts/AppLayout/notifier/notice.js
+4
-3
index.js
src/layouts/AppLayout/notifier/templates/alarm/index.js
+3
-0
index.js
src/layouts/AppLayout/notifier/templates/case/index.js
+5
-0
index.js
src/layouts/AppLayout/notifier/templates/notice/index.js
+10
-5
index.js
src/layouts/AppLayout/notifier/templates/unknown/index.js
+10
-9
index.js
src/layouts/AppLayout/notifier/utils/index.js
+28
-22
No files found.
src/layouts/AppLayout/notifier/message.js
View file @
7bb5d72d
...
@@ -12,6 +12,9 @@ class Message {
...
@@ -12,6 +12,9 @@ class Message {
webConfig
,
webConfig
,
webPath
,
webPath
,
messType
,
messType
,
defaultContent
,
webIcon
,
title
,
infoClasses
infoClasses
}
=
message
)
{
}
=
message
)
{
this
.
id
=
id
;
this
.
id
=
id
;
...
@@ -23,6 +26,9 @@ class Message {
...
@@ -23,6 +26,9 @@ class Message {
this
.
webConfig
=
webConfig
;
this
.
webConfig
=
webConfig
;
this
.
webPath
=
webPath
;
this
.
webPath
=
webPath
;
this
.
messType
=
messType
;
// 方案名称 - 大类型下细类型
this
.
messType
=
messType
;
// 方案名称 - 大类型下细类型
this
.
webIcon
=
webIcon
;
// 消息图标
this
.
title
=
title
;
// 消息标题
this
.
defaultContent
=
defaultContent
;
this
.
infoClasses
=
infoClasses
;
this
.
infoClasses
=
infoClasses
;
}
}
}
}
...
@@ -64,6 +70,9 @@ export const createMessageFromHis = (hisMessage, options = {}) => {
...
@@ -64,6 +70,9 @@ export const createMessageFromHis = (hisMessage, options = {}) => {
webConfig
:
hisMessage
.
web_config
,
webConfig
:
hisMessage
.
web_config
,
webPath
:
hisMessage
.
web_path
,
webPath
:
hisMessage
.
web_path
,
messType
:
hisMessage
.
messType
,
messType
:
hisMessage
.
messType
,
defaultContent
:
(
_
.
isString
(
hisMessage
.
defaultContent
)
&&
hisMessage
.
defaultContent
.
replace
(
new
RegExp
(
/ /g
),
""
).
length
>
0
)
?
hisMessage
.
defaultContent
:
null
,
webIcon
:
(
_
.
isString
(
hisMessage
.
webIcon
)
&&
hisMessage
.
webIcon
.
replace
(
new
RegExp
(
/ /g
),
""
).
length
>
0
)
?
hisMessage
.
webIcon
:
null
,
title
:
(
_
.
isString
(
hisMessage
.
title
)
&&
hisMessage
.
title
.
replace
(
new
RegExp
(
/ /g
),
""
).
length
>
0
)
?
hisMessage
.
title
:
null
,
infoClasses
,
infoClasses
,
};
};
return
createMessage
(
template
);
return
createMessage
(
template
);
...
@@ -101,6 +110,9 @@ export const createMessageFromReal = (realMesssage, options = {}) => {
...
@@ -101,6 +110,9 @@ export const createMessageFromReal = (realMesssage, options = {}) => {
webConfig
:
realMesssage
.
web_config
,
webConfig
:
realMesssage
.
web_config
,
webPath
:
realMesssage
.
web_path
,
webPath
:
realMesssage
.
web_path
,
messType
:
realMesssage
.
messType
,
messType
:
realMesssage
.
messType
,
defaultContent
:
(
_
.
isString
(
realMesssage
.
defaultContent
)
&&
realMesssage
.
defaultContent
.
replace
(
new
RegExp
(
/ /g
),
""
).
length
>
0
)
?
realMesssage
.
defaultContent
:
null
,
webIcon
:
(
_
.
isString
(
realMesssage
.
webIcon
)
&&
realMesssage
.
webIcon
.
replace
(
new
RegExp
(
/ /g
),
""
).
length
>
0
)
?
realMesssage
.
webIcon
:
null
,
title
:
(
_
.
isString
(
realMesssage
.
title
)
&&
realMesssage
.
title
.
replace
(
new
RegExp
(
/ /g
),
""
).
length
>
0
)
?
realMesssage
.
title
:
null
,
infoClasses
,
infoClasses
,
}
}
...
...
src/layouts/AppLayout/notifier/notice.js
View file @
7bb5d72d
...
@@ -473,12 +473,13 @@ class Notifier {
...
@@ -473,12 +473,13 @@ class Notifier {
};
};
speakOther
=
message
=>
{
speakOther
=
message
=>
{
// 类型区分‘全员公告’ 还是 ‘个人消息’
// 类型区分‘全员公告’ 还是 ‘个人消息’
const
type
=
isEmpty
(
message
.
tousers
)
||
parseMessage
.
tousers
===
''
?
'公告'
:
'消息'
;
const
type
=
message
.
title
??
(
isEmpty
(
message
.
tousers
)
||
parseMessage
.
tousers
===
''
?
'公告'
:
'消息'
)
;
// 构建语音消息内容
// 构建语音消息内容
const
{
infoContent
,
time
}
=
message
;
const
{
infoContent
,
time
}
=
message
;
let
content
=
replaceSpeak
((
infoContent
?.
content
??
''
).
replace
(
/
\\
n/g
,
','
));
let
content
=
replaceSpeak
((
infoContent
?.
content
??
message
.
defaultContent
??
''
).
replace
(
/
\\
n/g
,
','
));
let
msg
=
`您有新的
${
type
}
:
${
content
.
substring
(
0
,
content
.
lastIndexOf
(
','
)).
replace
(
':'
,
','
)}
时间:
${
time
}
`
;
const
text
=
content
.
substring
(
0
,
content
.
lastIndexOf
(
','
)).
replace
(
':'
,
','
);
let
msg
=
`您有新的
${
type
}
:
${
text
!==
''
?
text
:
content
}
时间:
${
time
}
`
;
this
.
speak
(
msg
);
this
.
speak
(
msg
);
};
};
...
...
src/layouts/AppLayout/notifier/templates/alarm/index.js
View file @
7bb5d72d
import
React
from
'react'
;
import
React
from
'react'
;
import
_
from
'lodash'
;
import
_
from
'lodash'
;
// eslint-disable-next-line import/no-unresolved
import
classNames
from
'classnames'
;
import
classNames
from
'classnames'
;
import
{
findPathByWidget
,
isJSON
}
from
'@wisdom-utils/components/lib/AppLayout/helpers'
;
import
{
findPathByWidget
,
isJSON
}
from
'@wisdom-utils/components/lib/AppLayout/helpers'
;
import
'../styles/common.less'
;
import
'../styles/common.less'
;
import
'./index.less'
;
import
'./index.less'
;
import
{
ConfigProvider
}
from
'antd'
;
import
{
ConfigProvider
}
from
'antd'
;
import
{
getMessageTypeIcon
}
from
'../../utils'
;
/* eslint-disable */
/* eslint-disable */
export
class
AlarmContent
{
export
class
AlarmContent
{
constructor
({
constructor
({
...
@@ -62,6 +64,7 @@ const Alarm = ({ message, confirmRead, config }) => {
...
@@ -62,6 +64,7 @@ const Alarm = ({ message, confirmRead, config }) => {
className
=
{
classNames
(
`
${
prefixCls
}
-notifier-message_scada`
,
`
${
prefixCls
}
-notifier-message-container`
)}
className
=
{
classNames
(
`
${
prefixCls
}
-notifier-message_scada`
,
`
${
prefixCls
}
-notifier-message-container`
)}
title
=
"点击查看详情"
title
=
"点击查看详情"
onClick
=
{()
=>
goPath
(
message
)}
onClick
=
{()
=>
goPath
(
message
)}
style
=
{{
backgroundImage
:
`url(
${
getMessageTypeIcon
(
message
)}
)`
}}
>
>
<
div
className
=
{
`
${
prefixCls
}
-notifier-message-title`
}
>
<
div
className
=
{
`
${
prefixCls
}
-notifier-message-title`
}
>
<
span
>
{
alarmType
}
<
/span
>
<
span
>
{
alarmType
}
<
/span
>
...
...
src/layouts/AppLayout/notifier/templates/case/index.js
View file @
7bb5d72d
import
React
from
'react'
;
import
React
from
'react'
;
import
{
ConfigProvider
}
from
'antd'
;
import
{
ConfigProvider
}
from
'antd'
;
// eslint-disable-next-line import/no-unresolved
import
classNames
from
'classnames'
;
import
classNames
from
'classnames'
;
import
'../styles/common.less'
;
import
'../styles/common.less'
;
import
'./index.less'
;
import
'./index.less'
;
import
{
getMessageTypeIcon
}
from
'../../utils'
;
// "caseType":"待办工单","flowName":"维修处理流程","nodeName":"审核关单","content":"请迅速到现场处理","time":"2020-11-03 09:11:12"
// "caseType":"待办工单","flowName":"维修处理流程","nodeName":"审核关单","content":"请迅速到现场处理","time":"2020-11-03 09:11:12"
export
class
CaseContent
{
export
class
CaseContent
{
...
@@ -62,6 +64,7 @@ const Case = ({ message, confirmRead }) => {
...
@@ -62,6 +64,7 @@ const Case = ({ message, confirmRead }) => {
className
=
{
classNames
(
`
${
prefixCls
}
-notifier-message_case`
,
`
${
prefixCls
}
-notifier-message-container`
)}
className
=
{
classNames
(
`
${
prefixCls
}
-notifier-message_case`
,
`
${
prefixCls
}
-notifier-message-container`
)}
title
=
"点击查看详情"
title
=
"点击查看详情"
onClick
=
{()
=>
goPath
(
message
)}
onClick
=
{()
=>
goPath
(
message
)}
style
=
{{
backgroundImage
:
`url(
${
getMessageTypeIcon
(
message
)}
)`
}}
>
>
<
div
className
=
{
`
${
prefixCls
}
-notifier-message-title`
}
>
<
div
className
=
{
`
${
prefixCls
}
-notifier-message-title`
}
>
<
span
>
{
caseType
}
<
/span
>
<
span
>
{
caseType
}
<
/span
>
...
@@ -72,7 +75,9 @@ const Case = ({ message, confirmRead }) => {
...
@@ -72,7 +75,9 @@ const Case = ({ message, confirmRead }) => {
e
.
stopPropagation
();
e
.
stopPropagation
();
confirmRead
(
false
,
[
message
.
id
]);
confirmRead
(
false
,
[
message
.
id
]);
}}
}}
// eslint-disable-next-line global-require
src
=
{
require
(
'../../images/oper/ok_line.png'
)}
src
=
{
require
(
'../../images/oper/ok_line.png'
)}
alt
=
""
/>
/>
<
/div
>
<
/div
>
<
div
className
=
{
`
${
prefixCls
}
-notifier-message-content`
}
>
<
div
className
=
{
`
${
prefixCls
}
-notifier-message-content`
}
>
...
...
src/layouts/AppLayout/notifier/templates/notice/index.js
View file @
7bb5d72d
import
React
from
'react'
;
import
React
from
'react'
;
import
{
ConfigProvider
}
from
'antd'
;
import
{
ConfigProvider
}
from
'antd'
;
// eslint-disable-next-line import/no-unresolved
import
classNames
from
'classnames'
;
import
classNames
from
'classnames'
;
import
'../styles/common.less'
;
import
'../styles/common.less'
;
import
'./index.less'
;
import
'./index.less'
;
import
{
getMessageTypeIcon
}
from
'../../utils'
;
export
class
NoticeContent
{
export
class
NoticeContent
{
// eslint-disable-next-line no-undef
// eslint-disable-next-line no-undef
...
@@ -15,7 +16,6 @@ export class NoticeContent {
...
@@ -15,7 +16,6 @@ export class NoticeContent {
}
}
}
}
const
Notice
=
({
message
,
confirmRead
,
config
,
handlerSysDetail
})
=>
{
const
Notice
=
({
message
,
confirmRead
,
config
,
handlerSysDetail
})
=>
{
const
{
getPrefixCls
}
=
React
.
useContext
(
ConfigProvider
.
ConfigContext
);
const
{
getPrefixCls
}
=
React
.
useContext
(
ConfigProvider
.
ConfigContext
);
const
prefixCls
=
getPrefixCls
();
const
prefixCls
=
getPrefixCls
();
...
@@ -25,7 +25,7 @@ const Notice = ({ message, confirmRead, config, handlerSysDetail }) => {
...
@@ -25,7 +25,7 @@ const Notice = ({ message, confirmRead, config, handlerSysDetail }) => {
const
noticeContent
=
message
?.
infoContent
?.
noticeContent
??
''
;
const
noticeContent
=
message
?.
infoContent
?.
noticeContent
??
''
;
// const remark = message?.infoContent?.remark;
// const remark = message?.infoContent?.remark;
const
goPath
=
(
item
)
=>
{
const
goPath
=
item
=>
{
confirmRead
(
false
,
[
message
.
id
]);
confirmRead
(
false
,
[
message
.
id
]);
handlerSysDetail
&&
handlerSysDetail
(
message
);
handlerSysDetail
&&
handlerSysDetail
(
message
);
};
};
...
@@ -35,16 +35,21 @@ const Notice = ({ message, confirmRead, config, handlerSysDetail }) => {
...
@@ -35,16 +35,21 @@ const Notice = ({ message, confirmRead, config, handlerSysDetail }) => {
className
=
{
classNames
(
`
${
prefixCls
}
-notifier-message_notice`
,
`
${
prefixCls
}
-notifier-message-container`
)}
className
=
{
classNames
(
`
${
prefixCls
}
-notifier-message_notice`
,
`
${
prefixCls
}
-notifier-message-container`
)}
title
=
"点击查看详情"
title
=
"点击查看详情"
onClick
=
{()
=>
goPath
(
message
)}
onClick
=
{()
=>
goPath
(
message
)}
style
=
{{
backgroundImage
:
`url(
${
getMessageTypeIcon
(
message
)}
)`
}}
>
>
<
div
className
=
{
`
${
prefixCls
}
-notifier-message-title`
}
>
<
div
className
=
{
`
${
prefixCls
}
-notifier-message-title`
}
>
<
span
>
{
noticeType
}{
noticeTitle
?
`:
${
noticeTitle
}
`
:
''
}
<
/span
>
<
span
>
{
noticeType
}
{
noticeTitle
?
`:
${
noticeTitle
}
`
:
''
}
<
/span
>
<
img
<
img
className
=
{
`
${
prefixCls
}
-notifier-message-confirm`
}
className
=
{
`
${
prefixCls
}
-notifier-message-confirm`
}
title
=
"点击标为已读"
title
=
"点击标为已读"
onClick
=
{
(
e
)
=>
{
onClick
=
{
e
=>
{
e
.
stopPropagation
();
e
.
stopPropagation
();
confirmRead
(
false
,
[
message
.
id
]);
confirmRead
(
false
,
[
message
.
id
]);
}}
}}
// eslint-disable-next-line global-require
src
=
{
require
(
'../../images/oper/ok_line.png'
)}
src
=
{
require
(
'../../images/oper/ok_line.png'
)}
alt
=
""
alt
=
""
/>
/>
...
...
src/layouts/AppLayout/notifier/templates/unknown/index.js
View file @
7bb5d72d
import
React
from
'react'
;
import
React
from
'react'
;
import
{
ConfigProvider
}
from
'antd'
;
import
{
ConfigProvider
}
from
'antd'
;
// eslint-disable-next-line import/no-unresolved
import
classNames
from
'classnames'
;
import
classNames
from
'classnames'
;
import
'../styles/common.less'
;
import
'../styles/common.less'
;
...
@@ -11,24 +12,23 @@ const Unknown = ({ message, confirmRead, handlerUnknowDetail }) => {
...
@@ -11,24 +12,23 @@ const Unknown = ({ message, confirmRead, handlerUnknowDetail }) => {
const
prefixCls
=
getPrefixCls
();
const
prefixCls
=
getPrefixCls
();
let
content
=
''
;
let
content
=
''
;
let
noticeTitle
=
''
;
let
noticeTitle
=
''
;
const
{
infoContent
}
=
message
;
try
{
try
{
const
type
=
typeof
message
.
infoContent
;
const
type
=
typeof
message
.
infoContent
;
switch
(
type
)
{
switch
(
type
)
{
case
'object'
:
case
'object'
:
let
{
infoContent
}
=
message
;
noticeTitle
=
message
.
title
||
infoContent
.
title
||
''
;
noticeTitle
=
infoContent
.
title
||
''
;
content
=
infoContent
.
content
||
message
.
defaultContent
||
JSON
.
stringify
(
message
.
infoContent
);
content
=
infoContent
.
content
||
JSON
.
stringify
(
message
.
infoContent
);
break
;
case
'string'
:
content
=
message
.
infoContent
;
break
;
break
;
default
:
default
:
noticeTitle
=
message
.
title
||
''
;
content
=
message
.
defaultContent
||
message
.
infoContent
;
break
;
break
;
}
}
}
catch
(
e
)
{
}
catch
(
e
)
{
// i
// i
}
}
const
goPath
=
(
item
)
=>
{
const
goPath
=
item
=>
{
handlerUnknowDetail
&&
handlerUnknowDetail
(
message
);
handlerUnknowDetail
&&
handlerUnknowDetail
(
message
);
confirmRead
(
false
,
[
message
.
id
]);
confirmRead
(
false
,
[
message
.
id
]);
};
};
...
@@ -37,17 +37,18 @@ const Unknown = ({ message, confirmRead, handlerUnknowDetail }) => {
...
@@ -37,17 +37,18 @@ const Unknown = ({ message, confirmRead, handlerUnknowDetail }) => {
className
=
{
classNames
(
`
${
prefixCls
}
-notifier-message_unknown`
,
`
${
prefixCls
}
-notifier-message-container`
)}
className
=
{
classNames
(
`
${
prefixCls
}
-notifier-message_unknown`
,
`
${
prefixCls
}
-notifier-message-container`
)}
title
=
"点击查看详情"
title
=
"点击查看详情"
onClick
=
{()
=>
goPath
(
message
)}
onClick
=
{()
=>
goPath
(
message
)}
style
=
{{
backgroundImage
:
`url(
${
getMessageTypeIcon
(
message
.
messType
)}
)`
}}
style
=
{{
backgroundImage
:
`url(
${
getMessageTypeIcon
(
message
)}
)`
}}
>
>
<
div
className
=
{
`
${
prefixCls
}
-notifier-message-title`
}
>
<
div
className
=
{
`
${
prefixCls
}
-notifier-message-title`
}
>
<
span
>
{
noticeTitle
}
<
/span
>
<
span
>
{
noticeTitle
}
<
/span
>
<
img
<
img
className
=
{
`
${
prefixCls
}
-notifier-message-confirm`
}
className
=
{
`
${
prefixCls
}
-notifier-message-confirm`
}
title
=
"点击标为已读"
title
=
"点击标为已读"
onClick
=
{
(
e
)
=>
{
onClick
=
{
e
=>
{
e
.
stopPropagation
();
e
.
stopPropagation
();
confirmRead
(
false
,
[
message
.
id
]);
confirmRead
(
false
,
[
message
.
id
]);
}}
}}
// eslint-disable-next-line global-require
src
=
{
require
(
'../../images/oper/ok_line.png'
)}
src
=
{
require
(
'../../images/oper/ok_line.png'
)}
alt
=
""
alt
=
""
/>
/>
...
...
src/layouts/AppLayout/notifier/utils/index.js
View file @
7bb5d72d
import
{
MESSAGE_TYPE
}
from
'../constants'
;
import
{
MESSAGE_TYPE
}
from
'../constants'
;
import
parseMessageToJSON
from
'./parse'
;
import
parseMessageToJSON
from
'./parse'
;
import
alarm
_i
con
from
'../images/types/alarm.png'
;
import
alarm
I
con
from
'../images/types/alarm.png'
;
import
approve
_i
con
from
'../images/types/approve.png'
;
import
approve
I
con
from
'../images/types/approve.png'
;
import
meeting
_i
con
from
'../images/types/meeting.png'
;
import
meeting
I
con
from
'../images/types/meeting.png'
;
import
notice
_i
con
from
'../images/types/notice.png'
;
import
notice
I
con
from
'../images/types/notice.png'
;
import
task
_i
con
from
'../images/types/task.png'
;
import
task
I
con
from
'../images/types/task.png'
;
import
work
_i
con
from
'../images/types/work.png'
;
import
work
I
con
from
'../images/types/work.png'
;
import
write
_i
con
from
'../images/types/write.png'
;
import
write
I
con
from
'../images/types/write.png'
;
import
other
_i
con
from
'../images/types/other.png'
;
import
other
I
con
from
'../images/types/other.png'
;
export
const
getMessageTypeIcon
=
messageType
=>
{
export
const
getMessageTypeIcon
=
message
=>
{
let
icon
=
other_icon
;
const
{
webIcon
}
=
message
;
if
(
webIcon
)
return
`
${
window
.
location
.
origin
}
/
${
webIcon
}
`
;
const
{
messageType
,
infoType
}
=
message
;
let
icon
=
otherIcon
;
if
(
infoType
===
'通用报警'
)
{
icon
=
alarmIcon
;
}
else
if
(
infoType
===
'系统通知'
)
{
icon
=
noticeIcon
;
}
else
if
(
infoType
===
'工单提醒'
)
{
icon
=
workIcon
;
}
if
(
!
messageType
)
return
icon
;
if
(
!
messageType
)
return
icon
;
if
(
messageType
===
'工时填报'
)
{
if
(
messageType
===
'工时填报'
)
{
icon
=
write
_i
con
;
icon
=
write
I
con
;
}
else
if
(
messageType
.
indexOf
(
'审批'
)
>
-
1
)
{
}
else
if
(
messageType
.
indexOf
(
'审批'
)
>
-
1
)
{
icon
=
approve
_i
con
;
icon
=
approve
I
con
;
}
else
if
(
messageType
.
indexOf
(
'会议'
)
>
-
1
)
{
}
else
if
(
messageType
.
indexOf
(
'会议'
)
>
-
1
)
{
icon
=
meeting
_i
con
;
icon
=
meeting
I
con
;
}
else
if
(
messageType
.
indexOf
(
'任务'
)
>
-
1
)
{
}
else
if
(
messageType
.
indexOf
(
'任务'
)
>
-
1
)
{
icon
=
task
_i
con
;
icon
=
task
I
con
;
}
}
return
icon
;
return
icon
;
};
};
export
const
getMessageClasses
=
messageType
=>
{
export
const
getMessageClasses
=
messageType
=>
{
let
infoType
=
''
;
let
infoType
=
''
;
switch
(
messageType
)
{
switch
(
messageType
)
{
...
@@ -54,7 +61,6 @@ export const getMessageClasses = messageType => {
...
@@ -54,7 +61,6 @@ export const getMessageClasses = messageType => {
return
infoType
;
return
infoType
;
};
};
/**
/**
* 消息语音单位转换
* 消息语音单位转换
* 说明:消息通过语音播放时,需要将一些字母单位转换成文字,不然会当做字母播放。
* 说明:消息通过语音播放时,需要将一些字母单位转换成文字,不然会当做字母播放。
...
@@ -76,16 +82,17 @@ export const replaceSpeak = msg => {
...
@@ -76,16 +82,17 @@ export const replaceSpeak = msg => {
return
msg
;
return
msg
;
};
};
// eslint-disable-next-line arrow-body-style
export
const
generatedId
=
()
=>
{
export
const
generatedId
=
()
=>
{
return
'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'
return
'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'
.
replace
(
/
[
xy
]
/g
,
function
(
c
)
{
.
replace
(
/
[
xy
]
/g
,
function
(
c
)
{
// eslint-disable-next-line no-bitwise
const
r
=
(
Math
.
random
()
*
16
)
|
0
;
const
r
=
(
Math
.
random
()
*
16
)
|
0
;
// eslint-disable-next-line no-bitwise
const
v
=
c
===
'x'
?
r
:
(
r
&
0x3
)
|
0x8
;
const
v
=
c
===
'x'
?
r
:
(
r
&
0x3
)
|
0x8
;
return
v
.
toString
(
16
);
return
v
.
toString
(
16
);
})
})
.
toUpperCase
();
.
toUpperCase
();
};
};
export
{
export
{
parseMessageToJSON
};
parseMessageToJSON
,
}
\ No newline at end of file
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