Commit e55e112a2b89a542411987634e09a296523851e7

Authored by boyang
1 parent 6ca03742

fix: 删除邮件人机验证,prod2-65/66

Showing 1 changed file with 73 additions and 67 deletions
pages/contact.vue
... ... @@ -42,29 +42,29 @@
42 42 rel="noopener noreferrer"
43 43 style="display: flex; align-items: center; gap: 8px"
44 44 >
45   - <span
46   - ><svg
47   - t="1733206392822"
48   - class="icon"
49   - viewBox="0 0 1024 1024"
50   - version="1.1"
51   - xmlns="http://www.w3.org/2000/svg"
52   - p-id="5464"
53   - width="20"
54   - height="20"
55   - >
56   - <path
57   - d="M948.245333 0H75.52C33.877333 0 0.021333 33.066667 0.021333 73.813333v876.288C0 990.890667 33.877333 1024 75.52 1024h872.704c41.749333 0 75.733333-33.109333 75.733333-73.898667V73.834667C1024 33.045333 989.994667 0 948.266667 0z"
58   - fill="#007BB5"
59   - p-id="5465"
60   - ></path>
61   - <path
62   - d="M151.744 383.893333h152.021333V872.533333H151.744V383.893333z m76.053333-242.922666a88.106667 88.106667 0 1 1-0.128 176.170666 88.106667 88.106667 0 0 1 0.128-176.170666M399.04 383.893333h145.578667v66.794667h2.090666c20.266667-38.4 69.802667-78.933333 143.701334-78.933333 153.770667 0 182.186667 101.184 182.186666 232.810666V872.533333h-151.850666v-237.653333c0-56.661333-0.981333-129.557333-78.933334-129.557333-79.018667 0-91.093333 61.76-91.093333 125.525333v241.706667h-151.68V383.872z"
63   - fill="#FFFFFF"
64   - p-id="5466"
65   - ></path></svg></span
66   - >LinkedIn</a
67   - >
  45 + <svg
  46 + t="1733206392822"
  47 + class="icon"
  48 + viewBox="0 0 1024 1024"
  49 + version="1.1"
  50 + xmlns="http://www.w3.org/2000/svg"
  51 + p-id="5464"
  52 + width="20"
  53 + height="20"
  54 + >
  55 + <path
  56 + d="M948.245333 0H75.52C33.877333 0 0.021333 33.066667 0.021333 73.813333v876.288C0 990.890667 33.877333 1024 75.52 1024h872.704c41.749333 0 75.733333-33.109333 75.733333-73.898667V73.834667C1024 33.045333 989.994667 0 948.266667 0z"
  57 + fill="#007BB5"
  58 + p-id="5465"
  59 + ></path>
  60 + <path
  61 + d="M151.744 383.893333h152.021333V872.533333H151.744V383.893333z m76.053333-242.922666a88.106667 88.106667 0 1 1-0.128 176.170666 88.106667 88.106667 0 0 1 0.128-176.170666M399.04 383.893333h145.578667v66.794667h2.090666c20.266667-38.4 69.802667-78.933333 143.701334-78.933333 153.770667 0 182.186667 101.184 182.186666 232.810666V872.533333h-151.850666v-237.653333c0-56.661333-0.981333-129.557333-78.933334-129.557333-79.018667 0-91.093333 61.76-91.093333 125.525333v241.706667h-151.68V383.872z"
  62 + fill="#FFFFFF"
  63 + p-id="5466"
  64 + ></path>
  65 + </svg>
  66 + LinkedIn
  67 + </a>
68 68 </span>
69 69 <span class="tw-mt-2">
70 70 <a
... ... @@ -208,13 +208,12 @@
208 208 @blur="v$.text.$touch"
209 209 @input="v$.text.$touch"
210 210 ></v-text-field>
211   -<!-- <div class="recaptcha-container" style="margin-bottom: 20px">-->
212   -<!-- &lt;!&ndash; reCAPTCHA v2 Checkbox &ndash;&gt;-->
213   -<!-- <div id="recaptcha" class="g-recaptcha"></div>-->
214   -<!-- &lt;!&ndash; 验证成功后显示的消息 &ndash;&gt;-->
215   -<!-- &lt;!&ndash; <div v-if="verified" class="success-message">验证通过!</div> &ndash;&gt;-->
216   -<!-- </div>-->
217   - <!-- <v-btn class="me-4" @click="v$.$validate"> submit </v-btn> -->
  211 + <!-- Recaptcha container commented out as requested
  212 + <div class="recaptcha-container" style="margin-bottom: 20px">
  213 + <div id="recaptcha" class="g-recaptcha"></div>
  214 + <div v-if="verified" class="success-message">验证通过!</div>
  215 + </div>
  216 + -->
218 217 <v-btn class="me-4" @click="handleSubmit"> submit </v-btn>
219 218 <v-btn @click="clear"> clear </v-btn>
220 219 </form>
... ... @@ -244,7 +243,7 @@ import { ref, reactive } from &quot;vue&quot;;
244 243 import { useVuelidate } from "@vuelidate/core";
245 244 import { email, required, maxLength } from "@vuelidate/validators";
246 245  
247   -const verified = ref(false); // 验证状态
  246 +const verified = ref(true); // 验证状态设为true,不再依赖reCAPTCHA
248 247 const snackbar = ref(false);
249 248 const snackbarFailed = ref(false);
250 249 const initialState = {
... ... @@ -259,29 +258,26 @@ const state = reactive({
259 258 });
260 259  
261 260 const handleSubmit = async () => {
262   - if (verified.value) {
263   - let { data } = await useAsyncData(
264   - "sendEmail",
265   - () =>
266   - $fetch("/email/send", {
267   - method: "POST",
268   - body: {
269   - firstName: state.firstName,
270   - lastName: state.lastName,
271   - email: state.email,
272   - message: state.text,
273   - subject: "",
274   - },
275   - }),
276   - {
277   - server: true, // 仅在服务器端获取数据
278   - }
279   - );
280   - if (data.value.message == "成功") {
281   - snackbar.value = true;
282   - } else {
283   - snackbarFailed.value = true;
  261 + // Removed verification condition since recaptcha is commented out
  262 + let { data } = await useAsyncData(
  263 + "sendEmail",
  264 + () =>
  265 + $fetch("/email/send", {
  266 + method: "POST",
  267 + body: {
  268 + firstName: state.firstName,
  269 + lastName: state.lastName,
  270 + email: state.email,
  271 + message: state.text,
  272 + subject: "",
  273 + },
  274 + }),
  275 + {
  276 + server: true, // 仅在服务器端获取数据
284 277 }
  278 + );
  279 + if (data.value.message == "成功") {
  280 + snackbar.value = true;
285 281 } else {
286 282 snackbarFailed.value = true;
287 283 }
... ... @@ -305,6 +301,8 @@ function clear() {
305 301 }
306 302 }
307 303  
  304 +// Recaptcha related code commented out as requested
  305 +/*
308 306 onMounted(() => {
309 307 // 动态加载 reCAPTCHA 脚本并初始化
310 308 loadRecaptchaScript(() => {
... ... @@ -356,16 +354,15 @@ const loadRecaptchaScript = (callback) =&gt; {
356 354  
357 355 // 脚本加载完成后的回调
358 356 script.onload = () => {
359   - // 修改开始
360 357 callback();
361   - }; // 修改结束
  358 + };
362 359  
363 360 // 脚本加载失败时的回调
364 361 script.onerror = () => {};
365 362  
366 363 document.head.appendChild(script);
367 364 };
368   -
  365 +*/
369 366 useHead({
370 367 title: "Contact",
371 368 });
... ... @@ -483,10 +480,13 @@ useHead({
483 480 @media screen and (min-width: 1537px) {
484 481 .image-name {
485 482 display: -webkit-box; /* Enables multi-line text handling */
486   - -webkit-box-orient: vertical; /* Defines the vertical orientation of the box */
  483 + -webkit-box-orient: vertical; /* Sets the vertical orientation of the box */
487 484 -webkit-line-clamp: 3; /* Limits the text to 3 lines */
488 485 overflow: hidden; /* Hides the overflowed text */
489 486 text-overflow: ellipsis; /* Adds an ellipsis when the text overflows */
  487 + white-space: normal; /* Allows the text to wrap */
  488 + line-height: 1.5em; /* Sets the line height */
  489 + min-height: calc(3 * 1.5em); /* Ensures the minimum height is 3 lines */
490 490 margin-top: 5px;
491 491 font-size: 16px;
492 492 width: 180px;
... ... @@ -498,10 +498,13 @@ useHead({
498 498 @media screen and (max-width: 1536px) and (min-width: 1281px) {
499 499 .image-name {
500 500 display: -webkit-box; /* Enables multi-line text handling */
501   - -webkit-box-orient: vertical; /* Defines the vertical orientation of the box */
  501 + -webkit-box-orient: vertical; /* Sets the vertical orientation of the box */
502 502 -webkit-line-clamp: 3; /* Limits the text to 3 lines */
503 503 overflow: hidden; /* Hides the overflowed text */
504 504 text-overflow: ellipsis; /* Adds an ellipsis when the text overflows */
  505 + white-space: normal; /* Allows the text to wrap */
  506 + line-height: 1.5em; /* Sets the line height */
  507 + min-height: calc(3 * 1.5em); /* Ensures the minimum height is 3 lines */
505 508 margin-top: 5px;
506 509 font-size: 16px;
507 510 width: 180px;
... ... @@ -513,10 +516,13 @@ useHead({
513 516 @media screen and (max-width: 1280px) {
514 517 .image-name {
515 518 display: -webkit-box; /* Enables multi-line text handling */
516   - -webkit-box-orient: vertical; /* Defines the vertical orientation of the box */
  519 + -webkit-box-orient: vertical; /* Sets the vertical orientation of the box */
517 520 -webkit-line-clamp: 3; /* Limits the text to 3 lines */
518 521 overflow: hidden; /* Hides the overflowed text */
519 522 text-overflow: ellipsis; /* Adds an ellipsis when the text overflows */
  523 + white-space: normal; /* Allows the text to wrap */
  524 + line-height: 1.5em; /* Sets the line height */
  525 + min-height: calc(3 * 1.5em); /* Ensures the minimum height is 3 lines */
520 526 margin-top: 5px;
521 527 font-size: 16px;
522 528 width: 180px;
... ... @@ -569,14 +575,14 @@ button .recommendButton {
569 575 transition: all 0.3s ease-in-out;
570 576 }
571 577 .clamp-text {
572   - display: -webkit-box; /* 使用弹性盒子 */
573   - -webkit-box-orient: vertical; /* 设置为垂直方向 */
574   - -webkit-line-clamp: 3; /* 限制最多显示3行 */
575   - overflow: hidden; /* 隐藏多余内容 */
576   - text-overflow: ellipsis; /* 添加省略号 */
577   - white-space: normal; /* 允许换行 */
578   - line-height: 1.5em; /* 设置每行的高度 */
579   - min-height: calc(3 * 1.5em); /* 确保最小高度为3行 */
  578 + display: -webkit-box; /* Enables multi-line text handling */
  579 + -webkit-box-orient: vertical; /* Sets the vertical orientation of the box */
  580 + -webkit-line-clamp: 3; /* Limits the text to 3 lines */
  581 + overflow: hidden; /* Hides the overflowed text */
  582 + text-overflow: ellipsis; /* Adds an ellipsis when the text overflows */
  583 + white-space: normal; /* Allows the text to wrap */
  584 + line-height: 1.5em; /* Sets the line height */
  585 + min-height: calc(3 * 1.5em); /* Ensures the minimum height is 3 lines */
580 586 }
581 587 span a {
582 588 color: black;
... ...