ionic使用cryptojs加密 复制到黏贴版 使用md5
npm install crypto-js
npm install --save @types/crypto-js
import * as crypto from "crypto-js";
crypto.DES.decrypt("Your secret", "YOUR_CRYPTO_KEY");
npm install clipboard
npm install --save @types/clipboard
import * as clipboard from "clipboard";
console.info("docp:" + clipboard.isSupported());
var clip = new clipboard(".adBtn", {
text: function (trigger) {
return "thissssssssss";
}
});
clip.on('success', function (e) {
console.info('Action:', e.action);
console.info('Text:', e.text);
console.info('Trigger:', e.trigger);
that.credit.alertMsg("复制成功" + e.text)
// e.clearSelection();
});
clip.on('error', function (e) {
console.error('Action:', e.action);
console.error('Trigger:', e.trigger);
});
npm install ts-md5 --save