我正在使用angular2-modal,这是this.modal.alert(),它的工作正常
但是当我在firebase中添加此行if
let key = "12345678".data(using: .utf8),
let data = Data(base64Encoded: encrypted, options: .ignoreUnknownCharacters) //<-#1
{
var numBytesDecrypted: size_t = 0
var result = Data(count: data.count) //<-#2
let err = result.withUnsafeMutableBytes {resultBytes in
data.withUnsafeBytes {dataBytes in
key.withUnsafeBytes {keyBytes in
CCCrypt(CCOperation(kCCDecrypt), CCAlgorithm(kCCAlgorithmDES), CCOptions(kCCOptionPKCS7Padding|kCCModeECB), keyBytes, kCCKeySizeDES, nil, dataBytes, data.count, resultBytes, result.count, &numBytesDecrypted) //<-#4
}
}
}
if err != CCCryptorStatus(kCCSuccess) {
NSLog("Decryption failed! Error: \(err.description)")
}
print(numBytesDecrypted)
result.count = numBytesDecrypted //<-#3
print(result as NSData) //`as NSData` is good for debugging.
return String(data: result, encoding: .utf8) ?? "???"
}
return "???"
时会给出错误
error_handler.js:54 EXCEPTION:未捕获(在承诺中):错误错误
和
zone.js:522未处理的承诺拒绝:Dialog被迫关闭 一个未知的来源。 ;区域:角;任务:Promise.then;值:
我想在点击 this.modal.alert()
的确定后输入路由网址this.router.navigate(['/dashboard/designRequestlist']);