diff --git a/src/utils/utils.ts b/src/utils/utils.ts index af3a459b..482b61aa 100644 --- a/src/utils/utils.ts +++ b/src/utils/utils.ts @@ -259,11 +259,12 @@ export const randomString = (stringLen: number): string => { export const encryptStr = (str: string): string => { const utf8Str = CryptoJS.enc.Utf8.parse(str) - const kStr = '0000neuronex0000' - const encrypted = CryptoJS.AES.encrypt(utf8Str, kStr, { - iv: kStr, + const key = CryptoJS.enc.Base64.parse('Wi02CrYTNIJtl8r8+LGII+rMvAJI1880FgXBNOTgnRw=') + const iv = CryptoJS.enc.Base64.parse('7+OE7gThf0PKTR9Py0aVhA==') + const encrypted = CryptoJS.AES.encrypt(utf8Str, key, { + iv, mode: CryptoJS.mode.CBC, padding: CryptoJS.pad.Pkcs7, }) - return encrypted.ciphertext.toString() + return encrypted.toString() } diff --git a/src/views/admin/Password.vue b/src/views/admin/Password.vue index 83dee0e5..fa95a887 100644 --- a/src/views/admin/Password.vue +++ b/src/views/admin/Password.vue @@ -107,11 +107,14 @@ const checkNewPassMatch = (rule: any, value: string, callback: any) => { if (newPassConfirm) { form.validateField(['newPassConfirm']) } + callback() } const checkNewPassConfirmMatch = (rule: any, value: string, callback: any) => { if (!isNewPassMatch.value) { callback(new Error(`${t('common.newPassNotMatch')}`)) + } else { + callback() } }