|
|
@@ -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', |
|
|
|