Browse Source

登入、註冊function加上async/await

Dev
Janie 2 years ago
parent
commit
7239a845ad
  1. 26
      FrontEnd/pages/user/index.vue
  2. 12
      FrontEnd/pages/user/signUp.vue

26
FrontEnd/pages/user/index.vue

@ -242,12 +242,12 @@
const authtoken = data.authtoken; const authtoken = data.authtoken;
that.$auth.$storage.removeUniversal('authtoken'); that.$auth.$storage.removeUniversal('authtoken');
that.$auth.$storage.setUniversal('authtoken', authtoken); that.$auth.$storage.setUniversal('authtoken', authtoken);
let path = that.$auth.$storage.getUniversal('userBeforePath');
if(path == "/user"){
path = "/";
}
that.$router.push({path: path});
} }
let path = that.$auth.$storage.getUniversal('userBeforePath');
if(path == "/user"){
path = "/";
}
that.$router.push({path: path});
}else if(response.data.STATUSCODE==500){ }else if(response.data.STATUSCODE==500){
that.$auth.redirect('login'); that.$auth.redirect('login');
}else if(response.data.STATUSCODE==401){ }else if(response.data.STATUSCODE==401){
@ -272,8 +272,8 @@
} }
}, },
// //
resendVerifyEmail() {
this.$axios
async resendVerifyEmail() {
await this.$axios
.post( .post(
`/trending/api/Signup/ReSendVerifyMail?Email=${this.userData.Account}` `/trending/api/Signup/ReSendVerifyMail?Email=${this.userData.Account}`
) )
@ -292,9 +292,9 @@
}, },
// //
userVerifyCode(value){
async userVerifyCode(value){
this.error = false; this.error = false;
this.$axios
await this.$axios
.get( .get(
`/trending/api/Signup/VerifyAccount?OrgID=${this.userInfo.OrgID}&MemberID=${this.userInfo.MemberID}&Code=${value}` `/trending/api/Signup/VerifyAccount?OrgID=${this.userInfo.OrgID}&MemberID=${this.userInfo.MemberID}&Code=${value}`
) )
@ -313,8 +313,8 @@
}); });
}, },
// //
ReactivateAccount(){
this.$axios
async ReactivateAccount(){
await this.$axios
.post( .post(
`/trending/api/Members/ReactivateAccountByAcc?Account=${this.userData.Account}` `/trending/api/Members/ReactivateAccountByAcc?Account=${this.userData.Account}`
) )
@ -339,8 +339,8 @@
this.valid = false; this.valid = false;
} }
}, },
checkExpireTime(){
this.$axios
async checkExpireTime(){
await this.$axios
.get(`/trending/api/System/RememberMe?Account=${this.$auth.$storage.getUniversal('userAccount')}`) .get(`/trending/api/System/RememberMe?Account=${this.$auth.$storage.getUniversal('userAccount')}`)
.then((response) => { .then((response) => {
//console.log(response); //console.log(response);

12
FrontEnd/pages/user/signUp.vue

@ -213,10 +213,10 @@ export default {
}, },
methods: { methods: {
// //
userRegister() {
async userRegister() {
const postUserData = { ...this.user }; const postUserData = { ...this.user };
this.isPageLoading = true; this.isPageLoading = true;
this.$axios
await this.$axios
.post( .post(
`/trending/api/Signup/SignupWithEmail`, postUserData `/trending/api/Signup/SignupWithEmail`, postUserData
) )
@ -242,9 +242,9 @@ export default {
}); });
}, },
// //
resendVerifyEmail() {
async resendVerifyEmail() {
this.countdown = 60; this.countdown = 60;
this.$axios
await this.$axios
.post( .post(
`/trending/api/Signup/ReSendVerifyMail?Email=${this.user.Email}` `/trending/api/Signup/ReSendVerifyMail?Email=${this.user.Email}`
) )
@ -255,9 +255,9 @@ export default {
}); });
}, },
// //
userVerifyCode(value){
async userVerifyCode(value){
this.error = false; this.error = false;
this.$axios
await this.$axios
.get( .get(
`/trending/api/Signup/VerifyAccount?OrgID=${this.userInfo.OrgID}&MemberID=${this.userInfo.MemberID}&Code=${value}` `/trending/api/Signup/VerifyAccount?OrgID=${this.userInfo.OrgID}&MemberID=${this.userInfo.MemberID}&Code=${value}`
) )

Loading…
Cancel
Save