Created
May 17, 2021 13:43
-
-
Save daniilgrigoryev/a6b659c149f9e1265d73460211c4bec2 to your computer and use it in GitHub Desktop.
someshit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| async signFiles() { | |
| try { | |
| await this.initCryptoThumbprint() | |
| let serializeDocuments = Object.entries(this.documents) | |
| .map(([fileSystem, files]) => { | |
| if (!!files.length) { | |
| return files.map((fileID) => { | |
| return { fileSystem, fileID } | |
| }) | |
| } | |
| }) | |
| .filter((item) => item !== undefined) | |
| .flat() | |
| return await Promise.all( | |
| serializeDocuments.map((item) => | |
| this.getSig(item.fileSystem, item.fileID) | |
| ) | |
| ) | |
| } catch (error) { | |
| let errorMessage = error.message || `Возникла проблема во время подписания документов` | |
| this.$emit('dialog', false) | |
| this.pushSnackbar(true, 'red', errorMessage) | |
| throw new Error(errorMessage) | |
| } | |
| }, | |
| async getSig(fileSystem, fileID) { | |
| await $axios.get(`/api/v2/application/doc-for-sign/${fileSystem}/${fileID}`) | |
| // const signFile = await this.$createAttachedSignature(this.thumbprint, fileBase.data.file, true) | |
| // const uploadSign = await this.uploadSign(fileID, fileSystem, signFile) | |
| // console.log(fileBase.status || 'error'); | |
| // console.log(fileBase); | |
| // signFile && (this.countSignDocuments += 1) | |
| // return fileBase | |
| }, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment