前端记住密码功能优化,密码RSA加密存cookie,RSA解密登录

This commit is contained in:
zhengjie
2019-06-29 17:11:03 +08:00
parent ac2253e552
commit 6a06c4a93c
4 changed files with 64 additions and 16 deletions

View File

@@ -1,5 +1,6 @@
import { login, getInfo } from '@/api/login'
import { getToken, setToken, removeToken } from '@/utils/auth'
import { decrypt } from '@/utils/rsaEncrypt'
const user = {
state: {
@@ -29,7 +30,7 @@ const user = {
// 登录
Login({ commit }, userInfo) {
const username = userInfo.username
const password = userInfo.password
const password = decrypt(userInfo.password)
const code = userInfo.code
const uuid = userInfo.uuid
const rememberMe = userInfo.rememberMe