Selaa lähdekoodia

feat: 调整找回密码页面功能以及交互

周玉环 6 päivää sitten
vanhempi
commit
dddd86df5e

+ 3 - 1
xinkeaboard-web/assets/language/en.js

@@ -831,7 +831,9 @@ export const lang_en = {
         '两次输入的密码不一致': 'The passwords entered twice are inconsistent',
         '注册成功': 'Registration successful',
         '您已注册成功, 5s内跳转到登录页': 'You have registered successfully. You will be redirected to the login page within 5 seconds',
-        '立即登录': 'Log in now'
+        '立即登录': 'Log in now',
+        '重置成功': 'Reset successful',
+        '密码重置成功, 5s内跳转至登录页': 'The password reset was successful. You will be redirected to the login page within 5 seconds'
     },
 
     // 人机验证

+ 3 - 1
xinkeaboard-web/assets/language/zh.js

@@ -858,7 +858,9 @@ export const lang_zn = {
       '两次输入的密码不一致': '两次输入的密码不一致',
       '注册成功': '注册成功',
       '您已注册成功, 5s内跳转到登录页': '您已注册成功, 5s内跳转到登录页',
-      '立即登录': '立即登录'
+      '立即登录': '立即登录',
+      '重置成功': '重置成功',
+      '密码重置成功, 5s内跳转至登录页': '密码重置成功, 5s内跳转至登录页'
     },
 
     // 人机验证

+ 1 - 1
xinkeaboard-web/assets/style/register.scss

@@ -34,7 +34,7 @@
         font-size: 14px;
         width: 50%;
         text-align: right;
-        .go_login_btn {
+        .go_login_btn, .go_register_btn {
           font-size: 13px;
           display: inline-block;
           padding: 6px 22px;

+ 119 - 0
xinkeaboard-web/components/GetEmailCode.vue

@@ -0,0 +1,119 @@
+<template>
+  <div class="email-code">
+    <span class="email-code-icon">
+      <img src="/register/mail_success.png" alt="" />
+    </span>
+    <input
+      type="text"
+      v-model="emailCode"
+      :placeholder="L['请输入验证码']"
+      class="input"
+      autocomplete="off"
+    />
+    <span class="email-code-accept">
+      <el-button
+        @click="getVerifyCode"
+        :disabled="countDownNumer"
+        :loading="getVerifyCodeLoading"
+      >
+        <span>{{ codeText }}</span>
+        <span v-if="countDownNumer">{{ `(${countDownNumer})` }}</span>
+      </el-button>
+    </span>
+  </div>
+</template>
+
+<script setup>
+import { getCurLanguage } from "@/composables/common.js";
+const L = getCurLanguage();
+
+const emits = defineEmits(["success"]);
+
+const props = defineProps({
+  beforeAction: {
+    type: Function | Promise,
+    default: () => {},
+  },
+  afterAction: {
+    type: Function | Promise,
+    default: () => {},
+  },
+});
+
+const emailCode = ref(""); // 邮箱验证码
+// 倒计时展示
+const countDownNumer = ref(0);
+
+const getVerifyCodeLoading = ref(false);
+
+// 重新获取验证码标识
+const isReacquireCode = ref(false);
+
+// 获取验证码的文案
+const codeText = computed(() => {
+  return isReacquireCode.value
+    ? L["register"]["重新获取"]
+    : L["register"]["获取验证码"];
+});
+
+const getVerifyCode = async () => {
+  if (typeof beforeAction === "function") {
+    beforeAction();
+  }
+  if (beforeAction instanceof Promise) {
+    await beforeAction();
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.email-code {
+  display: flex;
+  width: 100%;
+
+  &-icon {
+    width: 50px;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    border: 1px solid #e8e8e8;
+    border-right: none;
+    background: #f8f8f8;
+
+    img {
+      width: 20px;
+    }
+  }
+
+  input {
+    border: 1px solid #e8e8e8;
+    border-left: none;
+    border-right: none;
+    height: 40px;
+    padding: 0 0 0 10px;
+    width: 190px;
+  }
+
+  &-accept {
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    width: 90px;
+
+    .el-button {
+      width: 100%;
+      height: 100%;
+      color: #666;
+      background: #f8f8f8;
+      border-left: none;
+      border-radius: 0;
+      font-size: 12px;
+
+      &:hover {
+        border-color: #e8e8e8;
+        color: $colorMain;
+      }
+    }
+  }
+}
+</style>

+ 1 - 1
xinkeaboard-web/components/register/RegisterAccount.vue

@@ -174,7 +174,7 @@ const agree = () => {
 };
 
 const joinForFree = () => {
-  if (!isPasswordMatched) return;
+  if (!isPasswordMatched.value) return;
   if (!agreeFlag.value) {
     agreeErrorMsg.value = L["请同意用户注册协议及隐私政策"];
     return false;

+ 478 - 0
xinkeaboard-web/components/retrieve/RetrievePassword.vue

@@ -0,0 +1,478 @@
+<template>
+  <div class="center">
+    <div class="item account">
+      <span
+        style="color: #bbb; font-size: 21px; padding-top: 7px"
+        class="icon iconfont icon-wode"
+      ></span>
+      <input
+        type="text"
+        v-model="memberEmail"
+        :placeholder="L['请输入邮箱']"
+        class="input"
+      />
+      <div
+        data-type="userName"
+        class="cancel"
+        @click="clearInputVal('memberEmail')"
+      >
+        <span style="color: #bbb" class="iconfont icon-cuowu"></span>
+      </div>
+    </div>
+    <div class="error" v-if="emailErrorMsg">
+      <span
+        style="color: #e1251b; font-size: 14px"
+        class="iconfont icon-jubao"
+      ></span>
+      {{ emailErrorMsg }}
+    </div>
+    <!-- 邮箱验证码 -->
+    <div class="verify-code">
+      <span class="verify-code-icon">
+        <img src="/register/mail_success.png" alt="" />
+      </span>
+      <input
+        type="text"
+        v-model="emailCode"
+        :placeholder="L['请输入验证码']"
+        class="input"
+        autocomplete="off"
+      />
+      <span class="verify-code-accept">
+        <el-button
+          @click="getVerifyCode"
+          :disabled="countDownNumer"
+          :loading="getVerifyCodeLoading"
+        >
+          <span>{{ codeText }}</span>
+          <span v-if="countDownNumer">{{ `(${countDownNumer})` }}</span>
+        </el-button>
+      </span>
+    </div>
+    <div class="error" v-if="emailCodeErrorMsg">
+      <span
+        style="color: #e1251b; font-size: 14px"
+        class="iconfont icon-jubao"
+      ></span>
+      {{ emailCodeErrorMsg }}
+    </div>
+    <div class="item password">
+      <span
+        style="color: #bbb; font-size: 21px; padding-top: 7px"
+        class="icon iconfont icon-mima1"
+      ></span>
+      <input
+        :type="showPwdFlag ? 'text' : 'password'"
+        v-model="password"
+        :placeholder="L['请输入6~20位英文、数字、符号']"
+        class="input"
+      />
+      <div class="cancel" @click="isShowPwd">
+        <span
+          :style="{
+            color: '#bbb',
+            fontSize: showPwdFlag ? '20px' : '16px',
+          }"
+          :class="{
+            iconfont: true,
+            'icon-bukejian11': !showPwdFlag,
+            'icon-kejian': showPwdFlag,
+            show_pwd: showPwdFlag,
+          }"
+        ></span>
+      </div>
+    </div>
+    <div class="item confirm">
+      <span style="color: #bbb; font-size: 21px; padding-top: 7px" class="icon"
+        ><img src="/register/pwd_confirm.png" alt=""
+      /></span>
+      <input
+        class="input"
+        v-model="confirmPassword"
+        :type="showConfirmPwdFlag ? 'text' : 'password'"
+        :placeholder="L['register']['请确认密码']"
+        @blur="checkPwdMatched"
+      />
+      <div class="cancel" @click="isShowConfirmPwd">
+        <span
+          :style="{
+            color: '#bbb',
+            fontSize: showConfirmPwdFlag ? '20px' : '16px',
+          }"
+          :class="{
+            iconfont: true,
+            'icon-bukejian11': !showConfirmPwdFlag,
+            'icon-kejian': showConfirmPwdFlag,
+            show_pwd: showConfirmPwdFlag,
+          }"
+        ></span>
+      </div>
+    </div>
+    <div class="error" v-if="checkErrorMsg">
+      <span
+        style="color: #e1251b; font-size: 14px"
+        class="iconfont icon-jubao"
+      ></span>
+      {{ checkErrorMsg }}
+    </div>
+    <el-button
+      @click="forgetPwd"
+      :class="{ submit: true, disabled: forgetPwdDisabled }"
+      :disabled="forgetPwdDisabled"
+      :loading="forgetPwdLoading"
+      >{{ L["找回密码"] }}</el-button
+    >
+    <el-dialog
+      :title="L['register']['滑动验证']"
+      destroy-on-close
+      width="500px"
+      center
+      modal-class="retrieve-verify-model"
+      v-model="modalVisible"
+    >
+      <SliderVerify
+        :slideVerifyOptions="{ show: false, w: 450, h: 220 }"
+        @onSuccess="verifySuccess"
+        @onFail="verifyFail"
+      />
+    </el-dialog>
+  </div>
+</template>
+
+<script setup>
+import { showMessage, startCountdown } from "@/utils/common";
+import { getCurLanguage } from "@/composables/common.js";
+
+const emits = defineEmits(["success"]);
+
+const L = getCurLanguage();
+const emailCalc = ref();
+const memberEmail = ref(""); //用户邮箱
+const emailErrorMsg = ref(); //错误提示
+const emailCode = ref(""); // 邮箱验证码
+const emailCodeErrorMsg = ref(); //验证码错误提示
+
+// 倒计时展示
+const countDownNumer = ref(0);
+const getVerifyCodeLoading = ref(false);
+// 人机验证弹窗显示标识
+const modalVisible = ref(false);
+
+// 重新获取验证码标识
+const isReacquireCode = ref(false);
+// 人机校验通过标识符
+const isHMVerifySuccess = ref(false);
+
+const checkErrorMsg = ref(""); // 密码一致性错误提示
+const password = ref(""); //密码
+const confirmPassword = ref(""); //二次确认密码
+const showPwdFlag = ref(false); //密码是否明文显示,默认密文
+const showConfirmPwdFlag = ref(false); // 二次密码是否明文显示,默认密文
+
+const forgetPwdLoading = ref(false);
+
+const forgetPwdDisabled = computed(
+  () => !memberEmail.value || !password.value || !confirmPassword.value
+);
+
+// 获取验证码的文案
+const codeText = computed(() => {
+  return isReacquireCode.value
+    ? L["register"]["重新获取"]
+    : L["register"]["获取验证码"];
+});
+
+const isPasswordMatched = computed(
+  () => password.value === confirmPassword.value
+);
+
+//密码是否显示
+const isShowPwd = () => {
+  showPwdFlag.value = !showPwdFlag.value;
+};
+
+// 二次确认密码是否显示
+const isShowConfirmPwd = () => {
+  showConfirmPwdFlag.value = !showConfirmPwdFlag.value;
+};
+
+const checkPwdMatched = () => {
+  checkErrorMsg.value = isPasswordMatched.value
+    ? ""
+    : L["register"]["两次输入的密码不一致"];
+};
+
+// 人机验证成功
+const verifySuccess = () => {
+  isHMVerifySuccess.value = true;
+  modalVisible.value = false;
+  getVerifyCode();
+};
+
+//清空输入框内容
+const clearInputVal = (type) => {
+  if (type == "memberEmail") {
+    memberEmail.value = "";
+  }
+};
+
+// 人机校验失败
+const verifyFail = () => {
+  showMessage({
+    message: L["register"]["校验不通过"],
+    type: "warning",
+  });
+};
+
+// 校验邮箱
+const validateEmail = () => {
+  //邮箱非空的验证
+  if (!memberEmail.value) {
+    emailErrorMsg.value = L["请输入邮箱"];
+    return false;
+  }
+
+  // 邮箱格式验证
+  emailCalc.value = checkEmail(memberEmail.value);
+  if (emailCalc.value !== true) {
+    emailErrorMsg.value = emailCalc.value;
+    return false;
+  }
+  emailErrorMsg.value = "";
+
+  return true;
+};
+
+// 邮箱验证码验证
+const validateEmailCode = () => {
+  if (!emailCode.value) {
+    emailCodeErrorMsg.value = L["register"]["请输入邮箱验证码"];
+    return false;
+  }
+  emailCodeErrorMsg.value = "";
+
+  return true;
+};
+
+const getVerifyCode = () => {
+  if (!validateEmail()) return;
+  if (!isHMVerifySuccess.value) {
+    modalVisible.value = true;
+  } else {
+    getVerifyCodeLoading.value = true;
+    post("v3/member/front/active/verification/code", {
+      email: memberEmail.value,
+      source: 1,
+      type: 2, // 忘记密码
+    })
+      .then((res) => {
+        if (res.state === 200) {
+          showMessage({
+            message: L["register"]["验证码已发送"],
+            type: "success",
+          });
+          // 设置倒计时
+          startCountdown(60, (time) => (countDownNumer.value = time));
+          isReacquireCode.value = true;
+        } else {
+          showMessage({
+            message: res.msg,
+            type: "warning",
+          });
+        }
+      })
+      .finally(() => {
+        getVerifyCodeLoading.value = false;
+      });
+  }
+};
+
+const forgetPwd = () => {
+  if (!validateEmail() || !validateEmailCode()) return;
+  if (!isPasswordMatched.value) return;
+  forgetPwdLoading.value = true;
+  post("v3/member/front/active/email/reset/pwdNew", {
+    confirmPassWord: confirmPassword.value,
+    email: memberEmail.value,
+    loginPwd: password.value,
+    verificationCode: emailCode.value,
+  })
+    .then((res) => {
+      if (res.state == 200) {
+        //成功提示,并返回到登录页面
+        showMessage({
+          message: L["register"]["重置成功"],
+          type: "success",
+        });
+        emits("success");
+      } else {
+        //提示错误
+        showMessage({
+          message: res.msg,
+          type: "error",
+        });
+      }
+    })
+    .finally(() => {
+      forgetPwdLoading.value = false;
+    });
+};
+
+watch(memberEmail, (val) => {
+  if (val) {
+    emailErrorMsg.value = "";
+  }
+});
+
+watch(emailCode, (val) => {
+  if (val) {
+    emailCodeErrorMsg.value = "";
+  }
+});
+</script>
+
+<style lang="scss" scoped>
+.center {
+  padding: 30px 30px 40px;
+
+  .item {
+    position: relative;
+    margin-top: 15px;
+    border-radius: 2px;
+
+    &:first-child {
+      margin-top: 0;
+    }
+
+    .icon {
+      position: absolute;
+      left: 1px;
+      top: 1px;
+      width: 50px;
+      text-align: center;
+      height: 38px;
+      background: #f8f8f8;
+
+      img {
+        width: 20px;
+      }
+
+      .input {
+        border: 1px solid #e8e8e8;
+        height: 40px;
+        padding: 0 44px 0 60px;
+        width: 326px;
+      }
+    }
+
+    .input {
+      border: 1px solid #e8e8e8;
+      height: 40px;
+      padding: 0 44px 0 60px;
+      width: 326px;
+    }
+
+    &.code {
+      .input {
+        padding-right: 10px;
+        width: 150px;
+      }
+    }
+  }
+
+  .cancel {
+    position: absolute;
+    right: 0;
+    top: 1px;
+    width: 44px;
+    height: 38px;
+    cursor: pointer;
+
+    :before {
+      position: absolute;
+      top: 9px;
+      left: 14px;
+    }
+  }
+
+  .error {
+    margin-top: 10px;
+    position: relative;
+    color: $colorMain;
+    height: 16px;
+    line-height: 16px;
+  }
+
+  .verify-code {
+    display: flex;
+    width: 326px;
+    height: 40px;
+    margin-top: 10px;
+
+    &-icon {
+      width: 50px;
+      display: flex;
+      justify-content: center;
+      align-items: center;
+      border: 1px solid #e8e8e8;
+      border-right: none;
+      background: #f8f8f8;
+
+      img {
+        width: 20px;
+      }
+    }
+
+    input {
+      border: 1px solid #e8e8e8;
+      border-left: none;
+      border-right: none;
+      height: 40px;
+      padding: 0 0 0 10px;
+      width: 190px;
+    }
+
+    &-accept {
+      display: flex;
+      justify-content: center;
+      align-items: center;
+      width: 90px;
+
+      .el-button {
+        width: 100%;
+        height: 100%;
+        color: #666;
+        background: #f8f8f8;
+        border-left: none;
+        border-radius: 0;
+        font-size: 12px;
+
+        &:hover {
+          border-color: #e8e8e8;
+          color: $colorMain;
+        }
+      }
+    }
+  }
+
+  .submit {
+    margin-top: 35px;
+    background: $colorMain;
+    color: #fff;
+    text-align: center;
+    border-radius: 2px;
+    width: 100%;
+    height: 45px;
+    font-size: 18px;
+    letter-spacing: 0px;
+
+    &:hover {
+      opacity: 0.9;
+    }
+
+    &.disabled {
+      background-color: #909399;
+    }
+  }
+}
+</style>

+ 108 - 0
xinkeaboard-web/components/retrieve/RetrieveSuccess.vue

@@ -0,0 +1,108 @@
+<template>
+  <div class="retrieve-success">
+    <div class="retrieve-success-content">
+      <div class="retrieve-success-content__icon">
+        <div class="icon-circle">
+          <img src="/register/success.png" />
+        </div>
+      </div>
+      <div class="retrieve-success-content__tip">
+        <div class="tip-title">{{ L["register"]["重置成功"] }}</div>
+        <div class="tip-content">
+          {{ L["register"]["密码重置成功, 5s内跳转至登录页"] }}
+        </div>
+        <div class="line"></div>
+        <div class="login-button">
+          <el-button size="large" @click="goLogin">{{
+            L["register"]["立即登录"]
+          }}</el-button>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+
+
+<script setup>
+import { getCurLanguage } from "@/composables/common.js";
+import { useRouter } from "vue-router";
+
+const L = getCurLanguage();
+const router = useRouter();
+
+const goLogin = () => {
+  router.replace({
+    path: "/login",
+  });
+};
+
+setTimeout(() => {
+  goLogin()
+}, 5000)
+</script>
+
+
+<style lang="scss" scoped>
+.retrieve-success {
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+  align-items: center;
+  height: 386px;
+  padding: 0 20px;
+
+  &-content {
+    width: 240px;
+    height: 150px;
+    display: flex;
+
+    &__icon {
+      margin-right: 15px;
+      .icon-circle {
+        display: flex;
+        justify-content: center;
+        align-items: center;
+        width: 40px;
+        height: 40px;
+        border-radius: 100%;
+        background-color: $colorMain;
+
+        img {
+          width: 20px;
+        }
+      }
+    }
+
+    &__tip {
+      display: flex;
+      flex-direction: column;
+
+      .tip-title {
+        font-size: 25px;
+      }
+
+      .tip-content {
+        font-size: 12px;
+        color: #85899e;
+        margin-top: 10px;
+      }
+
+      .line {
+        width: 200px;
+        height: 0px;
+        border: 0.5px solid #dcdfe6;
+        margin: 30px 0;
+      }
+
+      .login-button {
+        // margin-top: 10px;
+
+        .el-button {
+          background-color: $colorMain;
+          color: #fff;
+        }
+      }
+    }
+  }
+}
+</style>

+ 30 - 27
xinkeaboard-web/pages/login.vue

@@ -85,11 +85,12 @@
               ></span>
               {{ errorMsg }}
             </div>
-            <a
-              href="javascript:void(0)"
+            <el-button
               @click="login"
-              :class="isLoading ? 'login_btn isLoading' : 'login_btn'"
-              >{{ L["登录"] }}</a
+              :class="{ submit: true, disabled: loginDisabled }"
+              :disabled="loginDisabled"
+              :loading="loginLoding"
+              >{{ L["登录"] }}</el-button
             >
           </div>
           <div
@@ -138,7 +139,9 @@ const fromurl = ref("");
 const wxEnable = ref("");
 const pwdCalc = ref();
 const ImgBG = ref("");
+const loginLoding = ref(false);
 
+const loginDisabled = computed(() => !name.value || !password.value);
 useHead({
   title: "Login",
   meta: [
@@ -178,10 +181,6 @@ const login = () => {
   param.username = name.value;
   param.password = password.value;
   param.loginType = loginType.value;
-  //防止重复提交
-  if (isLoading.value) {
-    return;
-  }
 
   //账号验证
   if (!param.username) {
@@ -201,10 +200,8 @@ const login = () => {
     }
   }
 
-  isLoading.value = true;
-
+  loginLoding.value = true;
   post("v3/frontLogin/oauth/token", param).then((res) => {
-    isLoading.value = false;
     if (res.state == 200) {
       //将用户信息存缓存,并跳转到首页
       filtersStore.setLoginStatus(true);
@@ -213,20 +210,23 @@ const login = () => {
       filtersStore.setTime(new Date().getTime().toString()); //存储refresh_token更新时间
       //获取用户信息,并同步信息到pinia
 
-      get("v3/member/front/member/getInfo").then((res) => {
-        if (res.state == 200) {
-          filtersStore.setMemberInfo(res.data);
-          if (window.history.state.back) {
-            // if(window.history.state.back == '/register' || window.history.state.back == '/member/login/forget' || window.history.state.back == '/member/login/forget' || window.history.state.back == '/member/login/forget'){
-            window.location.href = "/";
-            // }else{
-            //   window.location.href = window.history.state.back;
-            // }
-          } else {
-            router.replace({ path: "/member/home" });
+      get("v3/member/front/member/getInfo")
+        .then((res) => {
+          if (res.state == 200) {
+            filtersStore.setMemberInfo(res.data);
+            if (window.history.state.back) {
+              // if(window.history.state.back == '/register' || window.history.state.back == '/member/login/forget' || window.history.state.back == '/member/login/forget' || window.history.state.back == '/member/login/forget'){
+              window.location.href = "/";
+              // }else{
+              //   window.location.href = window.history.state.back;
+              // }
+            } else {
+              router.replace({ path: "/member/home" });
+            }
           }
-        }
-      });
+        }).catch(err => {
+          loginLoding.value = false;
+        })
     } else {
       //提示错误
       errorMsg.value = res.msg;
@@ -349,21 +349,24 @@ onMounted(() => {
     line-height: 16px;
   }
 
-  .login_btn {
-    display: block;
+  .submit {
     margin-top: 35px;
     background: $colorMain;
     color: #fff;
     text-align: center;
     border-radius: 2px;
+    width: 100%;
     height: 45px;
-    line-height: 45px;
     font-size: 18px;
     letter-spacing: 0px;
 
     &:hover {
       opacity: 0.9;
     }
+
+    &.disabled {
+      background-color: #909399;
+    }
   }
 }
 </style>

+ 31 - 132
xinkeaboard-web/pages/member/login/forget.vue

@@ -25,7 +25,7 @@
     <div class="sld_login_content">
       <img
         class="bg"
-        :src="ImgBG? ImgBG : configInfo.main_user_forget_password_bg + ''"
+        :src="ImgBG ? ImgBG : configInfo.main_user_forget_password_bg + ''"
         :onerror="defaultBgImg"
         alt
       />
@@ -34,51 +34,9 @@
           <div class="top">
             <div class="item1">{{ L["找回密码"] }}</div>
           </div>
-          <div class="center">
-            <div class="item account">
-              <span
-                style="color: #bbb; font-size: 21px; padding-top: 7px"
-                class="icon iconfont icon-wode"
-              ></span>
-              <input
-                type="text"
-                v-model="memberEmail"
-                :placeholder="L['请输入邮箱']"
-                class="input"
-              />
-              <div
-                data-type="userName"
-                class="cancel"
-                @click="clearInputVal('memberEmail')"
-              >
-                <span style="color: #bbb" class="iconfont icon-cuowu"></span>
-              </div>
-            </div>
-            <div class="item password">
-              <span
-                style="color: #bbb; font-size: 18px; padding-top: 8px"
-                class="icon iconfont icon-yanzhengma2"
-              ></span>
-              <input
-                type="text"
-                v-model="imgCode"
-                :placeholder="L['请输入图形验证码']"
-                class="input"
-              />
-              <img :src="showCodeImg" class="img_code" @click="getImgCode" />
-            </div>
-            <div class="error">
-              <span
-                v-if="errorMsg"
-                style="color: #e1251b; font-size: 14px"
-                class="iconfont icon-jubao"
-              ></span>
-              {{ errorMsg }}
-            </div>
-            <a href="javascript:void(0)" @click="forgetPwd" class="login_btn">{{
-              L["找回密码"]
-            }}</a>
-          </div>
+          <!-- 找回密码 -->
+          <RetrievePassword v-if="currentStep === 'reset'" @success="() => currentStep = 'finish'"/>
+          <RetrieveSuccess v-if="currentStep === 'finish'"/>
         </div>
       </div>
     </div>
@@ -86,116 +44,45 @@
 </template>
 
 <script setup>
-import { ElMessage,ElMessageBox } from "element-plus";
 import { useUserInfo } from "@/store/user.js";
 // import { lang_zn } from "@/assets/language/zh";
-import { getCurLanguage } from '@/composables/common.js';
+import { getCurLanguage } from "@/composables/common.js";
 import { useFiltersStore } from "@/store/filter.js";
+
 const filtersStore = useFiltersStore();
-// const L = lang_zn;
 const L = getCurLanguage();
 const configInfo = useUserInfo();
-const memberEmail = ref(""); //用户邮箱
-const errorMsg = ref(); //错误提示
 const router = useRouter();
-const { proxy } = getCurrentInstance();
-const showCodeImg = ref(""); //图形验证码图片
-const imgCodeKey = ref(""); //图形验证码的key
-const imgCode = ref(""); //图形验证码
 const defaultImg = ref("/common_top_logo.png");
 const defaultBgImg = ref("/forget_pwd_bg.png");
-const ImgBG = ref('')
+const ImgBG = ref("");
+const currentStep = ref('reset');
 
 useHead({
-  title: 'Forget Password',
+  title: "Forget Password",
   meta: [
     {
       name: "description",
-      content: 'Forget Password',
+      content: "Forget Password",
     },
     {
       name: "keywords",
-      content: 'Forget Password',
+      content: "Forget Password",
     },
   ],
 });
 
+
 //获取背景图
 const getBg = () => {
-  get('v3/system/front/setting/getSettings?names=main_user_forget_password_bg').then(res=>{
-    ImgBG.value = res.data[0]
-  })
-}
-getBg()
-
-const forgetPwd = () => {
-  let param = {};
-  param.email = memberEmail.value;
-  param.verifyCode = imgCode.value;
-  param.verifyKey = imgCodeKey.value;
-
-  //邮箱验证
-  if (!param.email) {
-    errorMsg.value = L["请输入邮箱"];
-    return false;
-  } else {
-    let checkEmail2 = checkEmail(param.email);
-    if (checkEmail2 !== true) {
-      errorMsg.value = checkEmail2;
-      return;
-    } else {
-      errorMsg.value = "";
-    }
-  }
-
-  //验证码校验
-  let checkImgCode2 = checkImgCode(param.verifyCode);
-  if (checkImgCode2 !== true) {
-    errorMsg.value = checkImgCode2;
-    return false;
-  }
-
-  post("v3/member/front/active/forget/pwd", param).then((res) => {
-    if (res.state == 200) {
-      //成功提示,并返回到登录页面
-      // ElMessage.success(res.msg + param.email);
-      // let msg = "<p style='color: #000;'><b>" + L["我们已经发邮件到"] + "</b> " + "<font color='#e13841'>"+param.email+"</font></p>" +
-      let msg = "<p style='color: #000;'><b>" + L["我们已经发邮件到"] + " " +param.email+"</b></p>" +
-              "<p>" + L["请按照邮件中的说明重新设置密码。"] + "</p>" +
-              "<p style='margin-top: 10px;color: #00985e;'>" + L["邮件可能需要几分钟才能到达。如果您没有收到,请检查您的垃圾邮件文件夹或请求另一封邮件。"] + "</p>";
-      ElMessageBox.alert(msg, L["温馨提示"], {dangerouslyUseHTMLString: true, confirmButtonText: L["好的"],});
-      setTimeout(() => {
-        router.back();
-      }, 500);
-    } else {
-      //提示错误
-      errorMsg.value = res.msg;
-    }
+  get(
+    "v3/system/front/setting/getSettings?names=main_user_forget_password_bg"
+  ).then((res) => {
+    ImgBG.value = res.data[0];
   });
 };
-//清空输入框内容
-const clearInputVal = (type) => {
-  if (type == "memberEmail") {
-    memberEmail.value = "";
-  }
-};
+getBg();
 
-watch([memberEmail, imgCode], () => {
-  imgCode.value = imgCode.value.substring(0, 4);
-  if (imgCode.value || memberEmail.value) {
-    errorMsg.value = "";
-  }
-});
-
-//获取图形验证码
-const getImgCode = () => {
-  get("v3/captcha/common/getCaptcha", {}).then((res) => {
-    if (res.state == 200) {
-      showCodeImg.value = "data:image/png;base64," + res.data.captcha;
-      imgCodeKey.value = res.data.key;
-    }
-  });
-};
 //通过replace方式跳转页面
 const goToPage = (type) => {
   router.replace({
@@ -203,11 +90,23 @@ const goToPage = (type) => {
   });
 };
 onMounted(() => {
-  getImgCode(); //获取图形验证码
-
   document.body.classList.remove("el-popup-parent--hidden");
 });
 </script>
+
+<style lang="scss">
+.retrieve-verify-model {
+  .el-dialog__title {
+    font-weight: 900 !important;
+  }
+
+  .el-dialog__body {
+    display: flex;
+    justify-content: center;
+    align-items: center;
+  }
+}
+</style>
 <style lang="scss" scoped>
 @import "@/assets/style/register.scss";