Your ROOT_URL in app.ini is http://git.zky.com/ but you are visiting http://61.178.84.89:8998/wangxy/hyp-front/src/commit/869478cbcf67dccd47369fede33673e019c0d354/src/api/sm4.js You should set ROOT_URL correctly, otherwise the web may not work correctly.
hyp-front/src/api/sm4.js

16 lines
327 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

const sm4 =require('sm-crypto').sm4
//const key='7f5cd501e5548914edaed6824d3ff79d'//可以为16进制串或字节数组要求为128比特
/**
* 加密
* @param txt
* @returns {*}
*/
export function encrypt(txt,key) {
return sm4.encrypt(txt,key);
}
export function decrypt(txt,key) {
return sm4.decrypt(txt,key);
}