Commit 9fcff5f7 authored by Samir Sadyhov's avatar Samir Sadyhov 🤔

update NCALayer.js - подписание есэдо документов

parent 24454561
......@@ -76,10 +76,11 @@ this.NCALayer = {
if(me.successHandler) me.successHandler(me.info);
}
} else if(result.responseObject.hasOwnProperty('signedData')){
const {certificate, dataForSign, signedData} = result.responseObject;
const {certificate, dataForSign, signedData, esedoSign} = result.responseObject;
me.info.certificate = certificate;
me.info.dataForSign = dataForSign;
me.info.signedData = signedData;
if(esedoSign) me.info.esedoSign = esedoSign;
me.verificationKey();
} else {
me.info.xml = result.responseObject;
......@@ -140,7 +141,7 @@ this.NCALayer = {
},
signDocument: async function(socket){
const { rawdata } = await AS.FORMS.ApiUtils.simpleAsyncGet(`rest/api/docflow/doc/document_info?documentID=${this.documentID}&locale=${AS.OPTIONS.locale}`);
const { rawdata, isEsedoOutgoing } = await AS.FORMS.ApiUtils.simpleAsyncGet(`rest/api/docflow/doc/document_info?documentID=${this.documentID}&locale=${AS.OPTIONS.locale}`);
const param = {
module: 'kz.arta.synergy.signmodule',
......@@ -148,6 +149,11 @@ this.NCALayer = {
args: ["", "SIGN", rawdata]
};
if(isEsedoOutgoing && isEsedoOutgoing == "true") {
const digest = await AS.FORMS.ApiUtils.simpleAsyncPost(`rest/sign/esedo/getDigest?idDocument=${this.documentID}`);
param.args = [JSON.stringify(digest), "SIGN", rawdata]
}
if(!this.webSocket) this.webSocket = this.getNCALayerSocket();
setTimeout(() => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment