forked from drone/command-center-dashboard

shuishen
2025-04-11 3173a3f4f77e23d3ad2e2d89004c1b2c8383a7d8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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 ''
    }
}