Browse Source

[WHAT] 忘記密碼 [WHY] 開發 ShowEasy 前台

Dev
Janie 2 years ago
parent
commit
1ac9dd634f
  1. 36
      FrontEnd/pages/user/forgot.vue
  2. 13
      FrontEnd/pages/user/signUp.vue

36
FrontEnd/pages/user/forgot.vue

@ -2,7 +2,7 @@
<div
class="tw-bg-white md:tw-rounded-[24px] md:tw-mt-[30px] md:tw-pt-[60px] md:tw-pb-[150px] md:tw-px-[30px]"
>
<div v-if="Object.keys($route.query).length < 2">
<div v-if="Object.keys(result).length < 1">
<p class="tw-text-[26px] tw-font-bold tw-mb-[20px] md:tw-text-[18px]">
{{ $t("Forgot Password") }}
</p>
@ -42,7 +42,7 @@
</button>
</div>
</div>
<div v-if="Object.keys($route.query).length >= 2 && !resetSuccess">
<div v-if="Object.keys(result).length >= 1 && !resetSuccess">
<p class="title">{{ $t("Reset Password") }}</p>
<v-form v-model="resetValid">
<v-text-field
@ -141,6 +141,7 @@ export default {
//auth_code: "",
Password: "",
},
result: "",
rules: {
require: (value) => !!value || this.$t("Required."),
email: (v) =>
@ -175,9 +176,17 @@ export default {
}, 1000);
this.$axios
.post(`/trending/api/Signup/SendForgotMail?Email=${this.Email}`)
.then((result) => {})
.catch((err) => {
console.log(err);
.then((response) => {
console.log(JSON.stringify(response));
if(response && response.data && response.data.DATA && response.data.DATA.rel){
let data = response.data.DATA.rel
if(data){
this.result = data;
}
}
})
.catch((error) => {
console.log(error);
});
},
resetUserPass() {
@ -188,11 +197,14 @@ export default {
//this.userData.user_id = this.$route.query.user_uuid;
//this.userData.auth_code = this.$route.query.auth_code;
this.$axios
.post(`/trending/api/Signup/ResetPassword/?Email=${this.Email}&Password=${this.Password}`)
.then((res) => {
console.log(JSON.stringify(res));
.post(`/trending/api/Signup/ResetPassword?Email=${this.result}&Password=${this.userData.Password}`)
.then((response) => {
console.log(JSON.stringify(response));
if(response && response.data && response.data.DATA && response.data.DATA.rel){
let data = response.data.DATA.rel
if(data){
this.resetSuccess = !this.resetSuccess;
this.countdown = 5;
this.countdown = 3;
this.timer = setInterval(() => {
if (this.countdown > 0) {
this.countdown--;
@ -201,9 +213,11 @@ export default {
this.$router.push(this.localePath("/"));
}
}, 1000);
}
}
})
.catch((err) => {
console.log(err);
.catch((error) => {
console.log(error);
});
}
},

13
FrontEnd/pages/user/signUp.vue

@ -182,8 +182,11 @@ export default {
.post(
`/trending/api/Signup/SignupWithEmail`, postUserData
)
.then((res) => {
console.log(JSON.stringify(res));
.then((response) => {
//console.log(JSON.stringify(response));
if(response && response.data && response.data.DATA && response.data.DATA.rel){
let data = response.data.DATA.rel
if(data){
this.timer = setInterval(() => {
if (this.countdown > 0) {
this.countdown--;
@ -194,6 +197,8 @@ export default {
}, 1000);
this.isPageLoading = false;
this.dialog = !this.dialog;
}
}
})
.catch((err) => {
@ -203,8 +208,6 @@ export default {
});
},
resendVerifyEmail() {
this.countdown = 60;
this.$axios
@ -212,7 +215,7 @@ export default {
`/trending/api/Signup/ReSendVerifyMail?Email=${this.userData.Email}`
)
.then((res) => {
console.log(JSON.stringify(res));
//console.log(JSON.stringify(res));
clearInterval(this.timer);
this.timer = setInterval(() => {
if (this.countdown > 0) {

Loading…
Cancel
Save