DESKTOP-9BNTV8O
2025-03-11 3b87f36219202b4cec47840bd9f56fdbe53e7d04
Web/src/views/system/user/component/userCenter.vue
@@ -162,7 +162,7 @@
<script lang="ts" setup name="sysUserCenter">
import { onMounted, watch, reactive, ref } from 'vue';
import { storeToRefs } from 'pinia';
import { ElForm, ElMessageBox, genFileId } from 'element-plus';
import { ElMessage,ElForm, ElMessageBox, genFileId } from 'element-plus';
import type { UploadInstance, UploadProps, UploadRawFile } from 'element-plus';
import { useUserInfo } from '/@/stores/userInfo';
import { base64ToFile } from '/@/utils/base64Conver';
@@ -291,6 +291,16 @@
   ruleFormPasswordRef.value?.validate(async (valid: boolean) => {
      if (!valid) return;
      const passwordRegex = /^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{6,}$/;
      if (!passwordRegex.test(state.ruleFormPassword.passwordNew)) {
         ElMessage({
            message: '密码必须包含至少6位以上,并且同时包含数字和字母',
            type: "error",
         });
         return;
      }
      // SM2加密密码
      const cpwd: ChangePwdInput = { passwordOld: '', passwordNew: '' };
      const publicKey = window.__env__.VITE_SM_PUBLIC_KEY;