【问题标题】:e-signature function doesnt return anything电子签名功能不返回任何内容
【发布时间】:2020-12-05 16:46:49
【问题描述】:
openNCALayerChooseKeyDialog = (callback) => {
  this.callback = callback;
  const base64 = this.b64EncodeUnicode(callback);
  console.log('openNCALayerChooseKeyDialog');
  this.setMissedHeartbeatsLimitToMax();
  const object = {
       "module": "kz.gov.pki.knca.commonUtils",
       "method": "createCMSSignatureFromBase64",
       "args": ["PKCS12", "SIGNATURE", base64, false]
     };
  //getActiveTokens
  // getKeyInfo
  // signXml
  // createCMSSignatureFromFile
  // showFileChooser
  // createCMSSignatureFromBase64
     this.webSocket.send(JSON.stringify(object));
 };

ncalayer.openNCALayerChooseKeyDialog(({errorCode, result}) => {
        console.log('ncalayer');
            console.log(errorCode, result);
            if (errorCode !== undefined &&  result !== undefined) {
                console.log('errorCode');
                ncalayer.setStorePath(result);
                console.log(errorCode);
                if (ncalayer.password !== null) {
                    console.log('getXMLDocument');
                    this.getXMLDocument();
                } else {
                    console.log('showSetPasswordModal');
                    this.showSetPasswordModal();
                }
            }
        });

你好。我无法理解为什么我的函数没有返回任何错误 我只是赶上而不是打电话给 ncalayer 并检查密码,在我的 ncalayer 上放上签名按钮后,我旁边没有任何动作

【问题讨论】:

    标签: javascript e-signature


    【解决方案1】:

    将 OpenNCALayerChooseKeyDialog 更新为

    openNCALayerChooseKeyDialog = (callback) => {
      this.callback = callback;
      const base64 = this.b64EncodeUnicode(callback);
      console.log('openNCALayerChooseKeyDialog');
      this.setMissedHeartbeatsLimitToMax();
      const object = {
           "module": "kz.gov.pki.knca.commonUtils",
           "method": "createCMSSignatureFromBase64",
           "args": ["PKCS12", "SIGNATURE", base64, false]
         };
     
         this.callback(this.webSocket.send(JSON.stringify(object)));
     };
    

    【讨论】:

    • 对不起,但我在 ncalayer.openNCALayerChooseKeyDialog(({errorCode, result}) => {} 中尝试 console.log(errorCode, result) 时未定义
    • this.webSocket.send 是否返回任何内容?
    • 不,要捕获 websocket 消息,请使用 webSocket.onmessage = (event) => { // 解析事件 }
    猜你喜欢
    • 2016-10-26
    • 2020-04-03
    • 1970-01-01
    • 1970-01-01
    • 2015-10-01
    • 1970-01-01
    • 1970-01-01
    • 2020-04-27
    • 2019-04-06
    相关资源
    最近更新 更多