hotfix for digital sign method
This commit is contained in:
parent
c4d8128b67
commit
22075a959e
@ -76,21 +76,27 @@ export default class DigitalSignaturesList extends React.Component
|
||||
_sign = () =>
|
||||
{
|
||||
downloadQuestionnaire(false)
|
||||
.then(({ filedata, filename }) =>
|
||||
.then(({ file, filename }) =>
|
||||
{
|
||||
//let created_at = moment().format('DD-MM-yyyy');
|
||||
//let filename = `Коммерческое предложение №${this.props.proposal.proposalId} от ${createAt}.docx`
|
||||
let file = new File([ filedata ], filename);
|
||||
let file_to_sign = new File([ file ], filename);
|
||||
|
||||
console.log("this.state", this.state);
|
||||
console.log("file");
|
||||
console.log(file);
|
||||
|
||||
generateSignature(file, this.state.certificate_selected.certificate)
|
||||
console.log("file_to_sign");
|
||||
console.log(file_to_sign);
|
||||
|
||||
const now = moment().format("DDMMYYYY_HHmmss");
|
||||
generateSignature(file_to_sign, this.state.certificate_selected.certificate)
|
||||
.then(signature => {
|
||||
console.log("signature");
|
||||
console.log(signature);
|
||||
|
||||
fileDownload(signature, `${ filename }.sig`);
|
||||
fileDownload(filedata, filename);
|
||||
fileDownload(signature, `${ now }_${ filename }.sig`);
|
||||
fileDownload(file, `${ now }_${ filename }`);
|
||||
alert("Подписание ЭЦП прошло успешно.");
|
||||
});
|
||||
})
|
||||
|
||||
@ -11,23 +11,30 @@ export function isPluginCryptoProInstalled()
|
||||
{
|
||||
console.log("window.cadesplugin", "AFTER", window.cadesplugin);
|
||||
|
||||
window.cadesplugin.async_spawn(function *(args)
|
||||
if(window.cadesplugin !== undefined)
|
||||
{
|
||||
try
|
||||
window.cadesplugin.async_spawn(function *(args)
|
||||
{
|
||||
yield window.cadesplugin
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
console.error("isPluginCryptoProInstalled");
|
||||
console.error(e);
|
||||
|
||||
reject({ message: e })
|
||||
return;
|
||||
}
|
||||
|
||||
resolve();
|
||||
});
|
||||
try
|
||||
{
|
||||
yield window.cadesplugin
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
console.error("isPluginCryptoProInstalled");
|
||||
console.error(e);
|
||||
|
||||
reject({ message: e })
|
||||
return;
|
||||
}
|
||||
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
reject();
|
||||
}
|
||||
}, 500);
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user