基于uniapp框架开发微信小程序,引入国密SM4的依赖gm-crypt,在h5中可以执行,但是到微信开发者工具报n is not a constructor,请问该如何解决? 先在Hbulder软件中基于uniapp框架下引入 npm install gm-crypt 之后node_modules下载了gm-crypt 然后启动微信开发者工具,执行以下代码 let SM4 = require('gm-crypt')....
12 + * @memberof Crypt 13 + */ 14 + static stringToArrayBufferInUtf8 (str) { 15 + // if not browser env, then require node.js's util. otherwise just use window's 16 + const TextEncoder = (typeof window === 'undefined') ? require('util').TextEncoder : window.TextEncod...
let SM4 = require('gm-crypt').sm4 let configmmm = { key:'tjcsxhjk12345678', mode:'cbc', iv:'ivv61234yyer9876', cipherType:'base64' } let def = new SM4(configmmm) //这句话报错 catch: TypeError: n is not a constructor,在H5中是不报错的,只在微信开发者工具中报...
基于uniapp框架开发微信小程序,引入国密SM4的依赖gm-crypt,在h5中可以执行,但是到微信开发者工具报n is not a constructor,请问该如何解决? 先在Hbulder软件中基于uniapp框架下引入 npm install gm-crypt 之后node_modules下载了gm-crypt 然后启动微信开发者工具,执行以下代码 let SM4 = require('gm-...
基于uniapp框架开发微信小程序,引入国密SM4的依赖gm-crypt,在h5中可以执行,但是到微信开发者工具报n is not a constructor,请问该如何解决? 先在Hbulder软件中基于uniapp框架下引入 npm install gm-crypt 之后node_modules下载了gm-crypt 然后启动微信开发者工具,执行以下代码 let SM4 = require('gm-crypt')....