更新2.1.2版本,优化部门、角色权限,增加上下级关系;增加登录、系统、短信日志;优化省市区编码

This commit is contained in:
孟帅
2023-01-25 11:49:21 +08:00
parent 11fad0132d
commit 93e0fe7250
190 changed files with 35896 additions and 7208 deletions

25
web/src/utils/encrypt.ts Normal file
View File

@@ -0,0 +1,25 @@
import CryptoJS from 'crypto-js';
const defaultKey = 'f080a463654b2279';
export const aesEcb = {
// 加密
encrypt(word: string, keyStr: string = defaultKey): string {
const key = CryptoJS.enc.Utf8.parse(keyStr);
const src = CryptoJS.enc.Utf8.parse(word);
const encrypted = CryptoJS.AES.encrypt(src, key, {
mode: CryptoJS.mode.ECB,
padding: CryptoJS.pad.Pkcs7,
});
return encrypted.toString();
},
// 解密
decrypt(word: string, keyStr: string = defaultKey): string {
const key = CryptoJS.enc.Utf8.parse(keyStr);
const decrypt = CryptoJS.AES.decrypt(word, key, {
mode: CryptoJS.mode.ECB,
padding: CryptoJS.pad.Pkcs7,
});
return CryptoJS.enc.Utf8.stringify(decrypt).toString();
},
};

View File

@@ -1,10 +1,11 @@
import { Ref, UnwrapRef } from '@vue/reactivity';
import onerrorImg from '@/assets/images/onerror.png';
export interface Option {
label: string;
value: string;
key: string;
type: string;
value: string | number;
key: string | number;
// type: string;
listClass: 'default' | 'error' | 'primary' | 'info' | 'success' | 'warning';
}
@@ -51,3 +52,9 @@ export function adaModalWidth(dialogWidth: Ref<UnwrapRef<string>>) {
}
return dialogWidth.value;
}
// 图片加载失败显示自定义默认图片(缺省图)
export function errorImg(e: any): void {
e.target.src = onerrorImg;
e.target.onerror = null;
}