From 2ca94de8ede18ac07ccfd8dec7b6f6a707adde9b Mon Sep 17 00:00:00 2001
From: 张含笑 <zhx18749296735@163.com>
Date: Mon, 01 Sep 2025 11:20:24 +0800
Subject: [PATCH] Merge branch 'refs/heads/feature/v5.0/5.0.5' into patch_management

---
 src/views/system/userinfo.vue |   80 ++++++---------------------------------
 1 files changed, 13 insertions(+), 67 deletions(-)

diff --git a/src/views/system/userinfo.vue b/src/views/system/userinfo.vue
index acef2d7..b1ea7d2 100644
--- a/src/views/system/userinfo.vue
+++ b/src/views/system/userinfo.vue
@@ -108,22 +108,6 @@
         <el-button @click="reset">重置</el-button>
       </div>
     </div>
-    <!-- 密钥上传 -->
-    <div class="upload-file" v-else-if="checked === 2">
-      <img v-if="isSuccess === 'success'" :src="uploadSuccess" alt="" />
-      <div v-if="isSuccess === 'success'">上传成功</div>
-      <img v-if="isSuccess === 'error'" :src="uploadError" alt="" />
-      <div v-if="isSuccess === 'error'">上传失败</div>
-      <el-upload
-        action="/upload"
-        accept=".lic"
-        :show-file-list="false"
-        :before-upload="handleUpload"
-      >
-        <div class="upload-btn">密钥上传</div>
-      </el-upload>
-      <div class="password-time">密钥有效期:{{ passwordTime || '永久有效' }}</div>
-    </div>
   </div>
 </template>
 
@@ -136,7 +120,6 @@
 import request from '@/axios';
 import { getUserInfo, updateInfo, updatePassword } from '@/api/system/user';
 import { findLicenseDate } from '@/api/system/dict';
-import { uploadLicense } from '@/api/license/uploadLicense';
 import uploadSuccess from '@/assets/images/uoload-success.png';
 import uploadError from '@/assets/images/upload-error.png';
 import cancel1 from '@/assets/images/task/cancel1.png';
@@ -146,7 +129,7 @@
 const token = getToken();
 const userinforShow = defineModel('show');
 const userInfoAs = computed(() => store.state.user.userInfo);
-const titleList = ref(['个人信息', '修改密码', '密钥上传']);
+const titleList = ref(['个人信息', '修改密码']);
 const checked = ref(0);
 const uploadUrl = computed(
   () => `${import.meta.env.VITE_APP_API_URL}/blade-resource/oss/endpoint/put-file`
@@ -170,6 +153,16 @@
   }
   return true;
 };
+// 校验邮箱
+const validateEmail = () => {
+	if (!userInfo.value.email) return true // 允许为空
+	const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/
+	if (!emailRegex.test(userInfo.value.email)) {
+		ElMessage.error('请输入正确的邮箱地址')
+		return false
+	}
+	return true
+}
 const passwordForm = ref({
   oldPassword: '',
   newPassword: '',
@@ -221,9 +214,6 @@
 
 const titleClick = (item, index) => {
   checked.value = index;
-  if (index === 2) {
-    getFindLicenseDate();
-  }
 };
 const getUserInfoData = () => {
   getUserInfo().then(res => {
@@ -242,7 +232,7 @@
 const emit = defineEmits(['logout']);
 const submit = () => {
   if (checked.value === 0) {
-    // if (!validatePhone()) return
+   if (!validatePhone() || !validateEmail()) return
     userInfo.value.name = userInfo.value.realName;
     updateInfo(userInfo.value).then(res => {
       if (res.data.code === 200) {
@@ -285,21 +275,6 @@
 };
 const isSuccess = ref('');
 const passwordTime = ref('');
-const handleUpload = file => {
-  const formData = new FormData();
-  formData.append('file', file);
-  uploadLicense(formData)
-    .then(res => {
-      if (res.data.code !== 200) return ElMessage.error('上传失败');
-      ElMessage.success('上传成功');
-      isSuccess.value = 'success';
-      getFindLicenseDate();
-    })
-    .catch(err => {
-      isSuccess.value = 'error';
-      ElMessage.error('上传失败');
-    });
-};
 const getFindLicenseDate = () => {
   findLicenseDate()
     .then(res => {
@@ -415,34 +390,5 @@
 .passwordBox {
   margin-top: 40px;
 }
-.upload-file {
-  text-align: center;
-  margin-top: 60px;
-  .upload-btn {
-    width: 93px;
-    height: 38px;
-    background: #DDEBFF;
-    border-radius: 8px 8px 8px 8px;
-    border: 1px solid #409EFF;
-    text-align: center;
-    font-family: Source Han Sans CN, Source Han Sans CN;
-    font-weight: bold;
-    font-size: 14px;
-    color: #228CFA;
-    line-height: 38px;
-    text-align: center;
-    margin-top: 10px;
-  }
-  .password-time {
-    margin-top: 50px;
-    width: 100%;
-    height: 16px;
-    font-family: Source Han Sans CN, Source Han Sans CN;
-    font-weight: 400;
-    font-size: 14px;
-    color: #2d9dff;
-    line-height: 16px;
-    // text-align: left;
-  }
-}
+
 </style>

--
Gitblit v1.9.3