Bladeren bron

fix:注册信息存储的不对

张旭伟 1 week geleden
bovenliggende
commit
63cc1285a8
2 gewijzigde bestanden met toevoegingen van 12 en 1 verwijderingen
  1. 5 0
      components.d.ts
  2. 7 1
      src/view/register/index.vue

+ 5 - 0
components.d.ts

@@ -18,6 +18,7 @@ declare module 'vue' {
     VanCellGroup: typeof import('vant/es')['CellGroup']
     VanCheckbox: typeof import('vant/es')['Checkbox']
     VanCheckboxGroup: typeof import('vant/es')['CheckboxGroup']
+    VanDatePicker: typeof import('vant/es')['DatePicker']
     VanDialog: typeof import('vant/es')['Dialog']
     VanField: typeof import('vant/es')['Field']
     VanForm: typeof import('vant/es')['Form']
@@ -25,10 +26,14 @@ declare module 'vue' {
     VanImage: typeof import('vant/es')['Image']
     VanList: typeof import('vant/es')['List']
     VanNotify: typeof import('vant/es')['Notify']
+    VanPicker: typeof import('vant/es')['Picker']
+    VanPickerGroup: typeof import('vant/es')['PickerGroup']
     VanPopup: typeof import('vant/es')['Popup']
     VanRadio: typeof import('vant/es')['Radio']
     VanRadioGroup: typeof import('vant/es')['RadioGroup']
     VanRow: typeof import('vant/es')['Row']
+    VanStep: typeof import('vant/es')['Step']
+    VanSteps: typeof import('vant/es')['Steps']
     VanSwipe: typeof import('vant/es')['Swipe']
     VanSwipeItem: typeof import('vant/es')['SwipeItem']
     VanTab: typeof import('vant/es')['Tab']

+ 7 - 1
src/view/register/index.vue

@@ -230,7 +230,7 @@
   import { useDeptApi } from '/@/api/system/dept'
   import { useRouter, useRoute } from 'vue-router'
   import { showNotify } from 'vant'
-
+  import { enhancedEncrypt, decryptLoginData, encryptWithBackendConfig } from '/@/utils/aesCrypto';
   import { UserTypeTooltip } from '/@/constants/pageConstants'
   import { isPasswordValid } from '/@/utils/stringUtils'
 
@@ -285,6 +285,8 @@
       email: '', // 邮箱
       sex: '30', // 性别
       password: '', // 账户密码
+      saltValue: '', // 密码
+      token: '', // 登录凭证
       confirmPassword: '',
       status: '10', // 用户状态
       describe: '', // 用户描述
@@ -712,6 +714,10 @@
     }
 
     const params = JSON.parse(JSON.stringify(state.form))
+    // 使用与后端完全匹配的加密函数加密密码
+    const encryptedPassword = encryptWithBackendConfig(params.password);
+    params.saltValue = encryptedPassword; // 后端AES IV常量
+    params.token = localStorage.getItem('animalToken');
     params.password = sm3(params.password)
     delete params.confirmPassword
     params.startDate = params.startDate.join('-')