update 登录密码进行rsa非对称加密
This commit is contained in:
@@ -2,12 +2,14 @@ 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 { removeGlobal, RSA_PUBLIC_KEY } from '@/util/global'
|
||||
import app from '@/main'
|
||||
|
||||
const doLogin = (args) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
api.login(args).then(({ success, data, message }) => {
|
||||
let { account, password } = args
|
||||
password = encryptByRSA(password, RSA_PUBLIC_KEY)
|
||||
api.login({ account, password }).then(({ success, data, message }) => {
|
||||
if (success) {
|
||||
token.value = data
|
||||
app.$message.success('登录成功')
|
||||
|
||||
Reference in New Issue
Block a user