init
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import website from '@/config/website';
|
||||
import smCrypto from 'sm-crypto';
|
||||
|
||||
/**
|
||||
* sm2 加密方法
|
||||
* @param data
|
||||
* @returns {*}
|
||||
*/
|
||||
export function encrypt(data) {
|
||||
try {
|
||||
return smCrypto.sm2.doEncrypt(data, website.oauth2.publicKey, 0);
|
||||
} catch {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user