Crazy 1 month ago
parent
commit
c88e60f1c9

+ 9 - 2
src/views/Profile/components/FaceInfo.vue

@@ -50,9 +50,16 @@ const submitForm = async () => {
     const data = formData as unknown as ProfileVO;
     const res = await importUserData(data.photoUrl);
     console.log('API 响应:', res);
+    // 假设 msg 包含操作结果的信息
+    if (res === '更新照片成功' || res === '删除照片成功') {
+      // 显示成功提示
       message.success('照片上传成功');
-      // 在这里处理成功上传后的逻辑,例如更新用户信息
-
+      emit('success');
+    } else if (res ==='添加考勤用户并且增加照片成功') {
+      message.success(res);
+    } else {
+      message.error(res);
+    }
   } catch (error) {
     console.error(error);
     message.error('提交失败,请稍后重试');

+ 1 - 2
src/views/system/studentAttendanceManage/studentFaceManage/StudentFaceForm.vue

@@ -103,7 +103,6 @@ const emit = defineEmits(['success','error'])
      // 显示错误提示
      message.error(msg);
  // 发送错误事件
-//       emit('error');
  }
  } catch (error) {
  console.error(error);
@@ -126,4 +125,4 @@ const resetForm = () => {
 onMounted(() => {
  
 })
-</script>
+</script>