登录密码加密解码报错处理

This commit is contained in:
zhangdaihao
2019-07-22 09:48:55 +08:00
parent c2282c8392
commit 63c9c6e727
5 changed files with 47 additions and 16 deletions

View File

@ -1,4 +1,19 @@
import { getAction } from '@/api/manage'
import { ENCRYPTED_STRING } from "@/store/mutation-types"
import Vue from 'vue'
/**
* 获取加密字符串,并对结果进行缓存
*/
export function getEncryptedString() {
return getAction("/sys/getEncryptedString",{}).then((res)=>{
let encryptedString = {};
encryptedString.key = res.result.key;
encryptedString.iv = res.result.iv;
Vue.ls.set(ENCRYPTED_STRING, encryptedString, 7 * 24 * 60 * 60 * 1000);
return encryptedString;
});
}
/**
* AES加密 :字符串 key iv 返回base64