update 前端加入RSA非对称加密,后端暂时关闭加密

This commit is contained in:
2021-05-13 00:07:42 +08:00
parent 88fa93f87e
commit 1eea4dfa85
5 changed files with 21 additions and 1 deletions

View File

@@ -70,7 +70,7 @@ namespace Ewide.Core.Service
[AllowAnonymous]
public async Task<string> LoginAsync([Required] LoginInput input)
{
string pwd = RSAHandler.RSADecrypt(input.Password);
var pwd = input.Password; // RSAHandler.RSADecrypt(input.Password);
// 获取加密后的密码
var encryptPasswod = MD5Encryption.Encrypt(pwd);

View File

@@ -14,6 +14,7 @@
"crypto-js": "^4.0.0",
"echarts": "^5.0.2",
"highlight.js": "^10.7.2",
"jsencrypt": "^3.2.0",
"less": "^3.12.2",
"less-loader": "4.1.0",
"lodash": "^4.17.21",

View File

@@ -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
View 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
}

View File

@@ -5191,6 +5191,11 @@ jsbn@~0.1.0:
resolved "https://registry.npm.taobao.org/jsbn/download/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513"
integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM=
jsencrypt@^3.2.0:
version "3.2.0"
resolved "https://registry.nlark.com/jsencrypt/download/jsencrypt-3.2.0.tgz?cache=0&sync_timestamp=1619388058064&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fjsencrypt%2Fdownload%2Fjsencrypt-3.2.0.tgz#09242aabf1984165dcd7698fe6ed163be77c05f8"
integrity sha1-CSQqq/GYQWXc12mP5u0WO+d8Bfg=
jsesc@^2.5.1:
version "2.5.2"
resolved "https://registry.npm.taobao.org/jsesc/download/jsesc-2.5.2.tgz?cache=0&sync_timestamp=1603891224688&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjsesc%2Fdownload%2Fjsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4"