update 前端加入RSA非对称加密,后端暂时关闭加密
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { api } from '@/common/api'
|
||||
import { token } from '@/common/token'
|
||||
import { encryptByDES, decryptByDES } from '@/util/des'
|
||||
import { encryptByRSA } from '@/util/rsa'
|
||||
import { removeGlobal } from '@/util/global'
|
||||
import app from '@/main'
|
||||
|
||||
|
||||
13
Web/src/util/rsa/index.js
Normal file
13
Web/src/util/rsa/index.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import { JSEncrypt } from 'jsencrypt'
|
||||
/**
|
||||
* RSA加解密
|
||||
*/
|
||||
const encryptByRSA = (message, publicKey) => {
|
||||
const Encrypt = new JSEncrypt()
|
||||
Encrypt.setPublicKey(publicKey)
|
||||
return Encrypt.encrypt(message)
|
||||
}
|
||||
|
||||
export {
|
||||
encryptByRSA
|
||||
}
|
||||
Reference in New Issue
Block a user