修复南网登录时明文密码问题
This commit is contained in:
parent
54a2d757da
commit
ac39997809
|
|
@ -18,7 +18,7 @@ class HttpConfig {
|
||||||
// baseUrl = "https://z.csgmall.com.cn/gl"
|
// baseUrl = "https://z.csgmall.com.cn/gl"
|
||||||
// baseUrl = "http://192.168.2.160:39080" // 梁超
|
// baseUrl = "http://192.168.2.160:39080" // 梁超
|
||||||
// baseUrl = "http://192.168.2.218:39080" // 福
|
// baseUrl = "http://192.168.2.218:39080" // 福
|
||||||
target = "http://192.168.2.74:49080"; // 开发阶段后台ip
|
target = "http://192.168.2.158:49080"; // 开发阶段后台ip
|
||||||
// #endif
|
// #endif
|
||||||
// 基地址 (部署时使用 需要加 dev-api)
|
// 基地址 (部署时使用 需要加 dev-api)
|
||||||
// authPath = `${this.baseUrl}/dev-api/auth`
|
// authPath = `${this.baseUrl}/dev-api/auth`
|
||||||
|
|
|
||||||
|
|
@ -106,6 +106,11 @@
|
||||||
"node": ">= 0.4"
|
"node": ">= 0.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/jsencrypt": {
|
||||||
|
"version": "3.3.2",
|
||||||
|
"resolved": "https://repo.huaweicloud.com/repository/npm/jsencrypt/-/jsencrypt-3.3.2.tgz",
|
||||||
|
"integrity": "sha512-arQR1R1ESGdAxY7ZheWr12wCaF2yF47v5qpB76TtV64H1pyGudk9Hvw8Y9tb/FiTIaaTRUyaSnm5T/Y53Ghm/A=="
|
||||||
|
},
|
||||||
"node_modules/object-inspect": {
|
"node_modules/object-inspect": {
|
||||||
"version": "1.13.1",
|
"version": "1.13.1",
|
||||||
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz",
|
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz",
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"jsencrypt": "^3.3.2",
|
||||||
"qs": "^6.11.2",
|
"qs": "^6.11.2",
|
||||||
"uni-read-pages": "^1.0.5",
|
"uni-read-pages": "^1.0.5",
|
||||||
"uni-simple-router": "^2.0.8-beta.4"
|
"uni-simple-router": "^2.0.8-beta.4"
|
||||||
|
|
@ -113,6 +114,11 @@
|
||||||
"node": ">= 0.4"
|
"node": ">= 0.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/jsencrypt": {
|
||||||
|
"version": "3.3.2",
|
||||||
|
"resolved": "https://repo.huaweicloud.com/repository/npm/jsencrypt/-/jsencrypt-3.3.2.tgz",
|
||||||
|
"integrity": "sha512-arQR1R1ESGdAxY7ZheWr12wCaF2yF47v5qpB76TtV64H1pyGudk9Hvw8Y9tb/FiTIaaTRUyaSnm5T/Y53Ghm/A=="
|
||||||
|
},
|
||||||
"node_modules/object-inspect": {
|
"node_modules/object-inspect": {
|
||||||
"version": "1.13.1",
|
"version": "1.13.1",
|
||||||
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz",
|
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz",
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"jsencrypt": "^3.3.2",
|
||||||
"qs": "^6.11.2",
|
"qs": "^6.11.2",
|
||||||
"uni-read-pages": "^1.0.5",
|
"uni-read-pages": "^1.0.5",
|
||||||
"uni-simple-router": "^2.0.8-beta.4"
|
"uni-simple-router": "^2.0.8-beta.4"
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,10 @@
|
||||||
<script>
|
<script>
|
||||||
import { authPath, publicPath, systemPath } from "../../public";
|
import { authPath, publicPath, systemPath } from "../../public";
|
||||||
import store from "../../store/user";
|
import store from "../../store/user";
|
||||||
import { Mcaptcha } from "../../utils/mcaptcha";
|
// import { encrypt } from "../../utils/jsencrypt";
|
||||||
|
|
||||||
|
import { encrypt } from "../../utils/jsencrypt";
|
||||||
|
// import { Mcaptcha } from "../../utils/mcaptcha";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
@ -394,7 +397,8 @@
|
||||||
let that = this;
|
let that = this;
|
||||||
that.$refs.accountForm.validate().then((formData) => {
|
that.$refs.accountForm.validate().then((formData) => {
|
||||||
that.showLoading = true;
|
that.showLoading = true;
|
||||||
console.log(formData);
|
formData.password = encrypt(formData.password);
|
||||||
|
// console.log("登录时参数", formData);
|
||||||
that.$api.login
|
that.$api.login
|
||||||
.log(formData)
|
.log(formData)
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,23 @@
|
||||||
|
import JSEncrypt from "jsencrypt/bin/jsencrypt.min";
|
||||||
|
|
||||||
|
// 密钥对生成 http://web.chacuo.net/netrsakeypair
|
||||||
|
|
||||||
|
const publicKey =
|
||||||
|
"MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKoR8mX0rGKLqzcWmOzbfj64K8ZIgOdHnzkXSOVOZbFu/TJhZ7rFAN+eaGkl3C4buccQd/EjEsj9ir7ijT7h96MCAwEAAQ==";
|
||||||
|
|
||||||
|
const privateKey =
|
||||||
|
"MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAqhHyZfSsYourNxaY7Nt+PrgrxkiA50efORdI5U5lsW79MmFnusUA355oaSXcLhu5xxB38SMSyP2KvuKNPuH3owIDAQABAkAfoiLyL+Z4lf4Myxk6xUDgLaWGximj20CUf+5BKKnlrK+Ed8gAkM0HqoTt2UZwA5E2MzS4EI2gjfQhz5X28uqxAiEA3wNFxfrCZlSZHb0gn2zDpWowcSxQAgiCstxGUoOqlW8CIQDDOerGKH5OmCJ4Z21v+F25WaHYPxCFMvwxpcw99EcvDQIgIdhDTIqD2jfYjPTY8Jj3EDGPbH2HHuffvflECt3Ek60CIQCFRlCkHpi7hthhYhovyloRYsM+IS9h/0BzlEAuO0ktMQIgSPT3aFAgJYwKpqRYKlLDVcflZFCKY7u3UP8iWi1Qw0Y=";
|
||||||
|
|
||||||
|
// 加密
|
||||||
|
export function encrypt(txt) {
|
||||||
|
const encryptor = new JSEncrypt();
|
||||||
|
encryptor.setPublicKey(publicKey); // 设置公钥
|
||||||
|
return encryptor.encrypt(txt); // 对数据进行加密
|
||||||
|
}
|
||||||
|
|
||||||
|
// 解密
|
||||||
|
export function decrypt(txt) {
|
||||||
|
const encryptor = new JSEncrypt();
|
||||||
|
encryptor.setPrivateKey(privateKey); // 设置私钥
|
||||||
|
return encryptor.decrypt(txt); // 对数据进行解密
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue