From 155943abdb721194227e6af3a37fb69f73eb9c66 Mon Sep 17 00:00:00 2001 From: zhaochengke Date: Wed, 30 Nov 2022 10:12:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E5=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/login/index.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/api/login/index.js b/src/api/login/index.js index 3876903d..a82d8ed8 100644 --- a/src/api/login/index.js +++ b/src/api/login/index.js @@ -1,4 +1,7 @@ import request from '@/utils/request' +import { encrypt } from '@/utils/jsencrypt' // 公钥,私钥都声明在里面 + +const VUE_APP_ENABLE_SECRET = true; // 登录账密凭据加密 // 登录方法 export function login(username, password, code, uuid) { @@ -8,6 +11,11 @@ export function login(username, password, code, uuid) { code, uuid } + if(VUE_APP_ENABLE_SECRET) + { + data.username = encrypt(username); + data.password = encrypt(password); + } return request({ url: '/login', method: 'post',