Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
synergy-components
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
synergy-components
Commits
0ebe2c46
Commit
0ebe2c46
authored
Dec 25, 2024
by
Samir Sadyhov
🤔
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NCALayer - добавлена регистрация в синержи по эцп
parent
d48880be
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
2 deletions
+38
-2
constructor/library/NCALayer.js
constructor/library/NCALayer.js
+38
-2
No files found.
constructor/library/NCALayer.js
View file @
0ebe2c46
...
...
@@ -49,7 +49,6 @@ this.NCALayer = {
this
.
webSocket
.
onmessage
=
function
(
event
)
{
const
result
=
parseNcaLayerMsg
(
event
);
console
.
log
(
'
webSocket.onmessage
'
,
result
);
if
(
result
.
hasOwnProperty
(
'
code
'
))
{
if
(
result
.
code
==
200
)
{
if
(
result
.
responseObject
.
hasOwnProperty
(
'
keyId
'
))
{
...
...
@@ -149,7 +148,23 @@ this.NCALayer = {
},
registerSynergyEDS
:
async
function
(){
if
(
this
.
successHandler
)
this
.
successHandler
(
this
.
info
);
try
{
const
url
=
`../Synergy/rest/api/registerEDS`
;
const
response
=
await
fetch
(
url
,
{
method
:
'
POST
'
,
headers
:
{
"
Content-Type
"
:
"
application/json; charset=UTF-8
"
},
body
:
JSON
.
stringify
({
"
cert
"
:
this
.
info
.
xml
})
});
const
result
=
await
response
.
json
();
if
(
!
response
.
ok
)
throw
new
Error
(
result
.
errorMessage
);
if
(
this
.
successHandler
)
this
.
successHandler
(
result
);
}
catch
(
err
)
{
console
.
log
(
`ERROR [registerSynergyEDS]:
${
err
.
message
}
`
);
if
(
this
.
successHandler
)
this
.
successHandler
({
errorCode
:
13
,
errorMessage
:
err
.
message
});
}
},
authSynergyEDS
:
async
function
(){
...
...
@@ -244,6 +259,27 @@ this.NCALayer = {
this
.
successHandler
=
null
;
}
this
.
getAuthUUID
().
then
(
res
=>
{
const
timerID
=
setInterval
(()
=>
{
if
(
this
.
connect
)
{
this
.
signXML
(
res
.
uuid
);
clearInterval
(
timerID
);
}
},
500
);
});
},
registerEDS
:
function
(
handler
)
{
if
(
!
this
.
webSocket
)
this
.
initNCALayerSocket
();
this
.
keysConstType
=
'
registerEDS
'
;
this
.
info
=
{};
if
(
handler
&&
typeof
handler
==
'
function
'
)
{
this
.
successHandler
=
handler
;
}
else
{
this
.
successHandler
=
null
;
}
this
.
getAuthUUID
().
then
(
res
=>
{
const
timerID
=
setInterval
(()
=>
{
if
(
this
.
connect
)
{
...
...
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