8b2ae993 by zhen

feat:登录使用AES加密

1 parent 88207ae8
......@@ -5,7 +5,7 @@ const AES_KEY = '94a80df2633b4944'
export function aesEncode(str) {
const key = CryptoJS.enc.Utf8.parse(AES_KEY)
const word = CryptoJS.enc.Utf8.parse(str)
debugger
const encrypted = CryptoJS.AES.encrypt(word, key, {
mode: CryptoJS.mode.ECB,
padding: CryptoJS.pad.Pkcs7
......
......@@ -33,8 +33,8 @@ export default {
async handleLogin({ username, password }) {
try {
this.btnLoading = true
// const passPhrase = aesEncode(password)
const { code } = await this.login({ username, password })
const passPhrase = aesEncode(password)
const { code } = await this.login({ username, password: passPhrase })
if (code === 0) {
this.$router.push({ path: '/' })
} else {
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!