|
@ -4,6 +4,7 @@ |
|
|
class="xl:tw-grid xl:tw-grid-cols-[auto_414px] xl:tw-gap-[96px] xl:tw-max-w-[1246px] xl:tw-mx-auto xl:tw-px-[60px]"> |
|
|
class="xl:tw-grid xl:tw-grid-cols-[auto_414px] xl:tw-gap-[96px] xl:tw-max-w-[1246px] xl:tw-mx-auto xl:tw-px-[60px]"> |
|
|
<div class="tw-hidden xl:tw-block xl:tw-mt-[30px]"> |
|
|
<div class="tw-hidden xl:tw-block xl:tw-mt-[30px]"> |
|
|
<p class="welcome tw-text-primary-light">{{ $t("Welcome to ShowEasy") }}</p> |
|
|
<p class="welcome tw-text-primary-light">{{ $t("Welcome to ShowEasy") }}</p> |
|
|
|
|
|
{{ userData.Account }} {{ userData.Password }} |
|
|
{{ user }} |
|
|
{{ user }} |
|
|
<p class="sub tw-text-neutral-400"> |
|
|
<p class="sub tw-text-neutral-400"> |
|
|
{{ |
|
|
{{ |
|
@ -50,15 +51,15 @@ |
|
|
{{ $t("Welcome to ShowEasy!") }} |
|
|
{{ $t("Welcome to ShowEasy!") }} |
|
|
</p> |
|
|
</p> |
|
|
<v-form v-model="valid"> |
|
|
<v-form v-model="valid"> |
|
|
<v-text-field v-model="userData.FirstName" background-color="neutrals darken-1" |
|
|
|
|
|
|
|
|
<v-text-field v-model="user.FirstName" background-color="neutrals darken-1" |
|
|
:label="this.$t('First Name') + '*'" placeholder="" filled rounded dense single-line :rules="[rules.require]"> |
|
|
:label="this.$t('First Name') + '*'" placeholder="" filled rounded dense single-line :rules="[rules.require]"> |
|
|
</v-text-field> |
|
|
</v-text-field> |
|
|
<v-text-field v-model="userData.LastName" background-color="neutrals darken-1" |
|
|
|
|
|
|
|
|
<v-text-field v-model="user.LastName" background-color="neutrals darken-1" |
|
|
:label="this.$t('Last Name') + '*'" placeholder="" filled rounded dense single-line :rules="[rules.require]"> |
|
|
:label="this.$t('Last Name') + '*'" placeholder="" filled rounded dense single-line :rules="[rules.require]"> |
|
|
</v-text-field> |
|
|
</v-text-field> |
|
|
<v-text-field v-model="userData.Email" background-color="neutrals darken-1" :label="this.$t('Email') + '*'" |
|
|
|
|
|
|
|
|
<v-text-field v-model="user.Email" background-color="neutrals darken-1" :label="this.$t('Email') + '*'" |
|
|
filled rounded dense single-line :rules="[rules.email, rules.require]" validate-on-blur></v-text-field> |
|
|
filled rounded dense single-line :rules="[rules.email, rules.require]" validate-on-blur></v-text-field> |
|
|
<v-text-field v-model="userData.Password" background-color="neutrals darken-1" |
|
|
|
|
|
|
|
|
<v-text-field v-model="user.Password" background-color="neutrals darken-1" |
|
|
:label="this.$t('Password') + '*'" :type="showPass ? 'text' : 'password'" placeholder="" filled rounded dense |
|
|
:label="this.$t('Password') + '*'" :type="showPass ? 'text' : 'password'" placeholder="" filled rounded dense |
|
|
single-line :rules="[rules.checkPassword, rules.require]" :hint=" |
|
|
single-line :rules="[rules.checkPassword, rules.require]" :hint=" |
|
|
this.$t( |
|
|
this.$t( |
|
@ -72,7 +73,7 @@ |
|
|
:append-icon="showConfirmPass ? 'mdi-eye' : 'mdi-eye-off'" @click:append="showConfirmPass = !showConfirmPass" |
|
|
:append-icon="showConfirmPass ? 'mdi-eye' : 'mdi-eye-off'" @click:append="showConfirmPass = !showConfirmPass" |
|
|
validate-on-blur></v-text-field> |
|
|
validate-on-blur></v-text-field> |
|
|
</v-form> |
|
|
</v-form> |
|
|
<v-checkbox v-model="userData.Subscribe" class="mt-n2 ml-1"><template v-slot:label><span |
|
|
|
|
|
|
|
|
<v-checkbox v-model="user.Subscribe" class="mt-n2 ml-1"><template v-slot:label><span |
|
|
class="neutrals--text text--darken-4 text-size-14">{{ |
|
|
class="neutrals--text text--darken-4 text-size-14">{{ |
|
|
$t("Subscribe to ShowEasy\’s newsletter") |
|
|
$t("Subscribe to ShowEasy\’s newsletter") |
|
|
}}</span></template></v-checkbox> |
|
|
}}</span></template></v-checkbox> |
|
@ -93,7 +94,7 @@ |
|
|
</v-spacer> |
|
|
</v-spacer> |
|
|
<v-spacer class="text-size-16 my-7 neutrals--text text--darken-4">{{ $t("We've sent a verification email to") |
|
|
<v-spacer class="text-size-16 my-7 neutrals--text text--darken-4">{{ $t("We've sent a verification email to") |
|
|
}}<br /> |
|
|
}}<br /> |
|
|
<span class="primary--text">{{ userData.Email }}</span>{{ |
|
|
|
|
|
|
|
|
<span class="primary--text">{{ user.Email }}</span>{{ |
|
|
$t(". Please click the link within to activate your account.") |
|
|
$t(". Please click the link within to activate your account.") |
|
|
}} |
|
|
}} |
|
|
</v-spacer> |
|
|
</v-spacer> |
|
@ -184,10 +185,10 @@ export default { |
|
|
"Passwords must be 8-20 characters with at least 1 number, 1 lower case letter and 1 upper case letter" |
|
|
"Passwords must be 8-20 characters with at least 1 number, 1 lower case letter and 1 upper case letter" |
|
|
), |
|
|
), |
|
|
checkConfirmPassword: (v) => |
|
|
checkConfirmPassword: (v) => |
|
|
this.confirmPasswordText === this.userData.Password || |
|
|
|
|
|
|
|
|
this.confirmPasswordText === this.user.Password || |
|
|
this.$t("Your password and confirmation password do not match"), |
|
|
this.$t("Your password and confirmation password do not match"), |
|
|
}, |
|
|
}, |
|
|
userData: { |
|
|
|
|
|
|
|
|
user: { |
|
|
FirstName: "", |
|
|
FirstName: "", |
|
|
LastName: "", |
|
|
LastName: "", |
|
|
Account: "", |
|
|
Account: "", |
|
@ -198,6 +199,10 @@ export default { |
|
|
signUp: false, |
|
|
signUp: false, |
|
|
userInfo: {}, |
|
|
userInfo: {}, |
|
|
error: false, |
|
|
error: false, |
|
|
|
|
|
userData: { |
|
|
|
|
|
Account: '', |
|
|
|
|
|
Password: '', |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
@ -214,7 +219,7 @@ export default { |
|
|
methods: { |
|
|
methods: { |
|
|
//會員註冊 |
|
|
//會員註冊 |
|
|
userRegister() { |
|
|
userRegister() { |
|
|
const postUserData = { ...this.userData }; |
|
|
|
|
|
|
|
|
const postUserData = { ...this.user }; |
|
|
this.isPageLoading = true; |
|
|
this.isPageLoading = true; |
|
|
this.$axios |
|
|
this.$axios |
|
|
.post( |
|
|
.post( |
|
@ -248,14 +253,14 @@ export default { |
|
|
}) |
|
|
}) |
|
|
.catch((err) => { |
|
|
.catch((err) => { |
|
|
console.log(err); |
|
|
console.log(err); |
|
|
}); |
|
|
|
|
|
|
|
|
}); |
|
|
}, |
|
|
}, |
|
|
//重新寄出認證碼 |
|
|
//重新寄出認證碼 |
|
|
resendVerifyEmail() { |
|
|
resendVerifyEmail() { |
|
|
this.countdown = 60; |
|
|
this.countdown = 60; |
|
|
this.$axios |
|
|
this.$axios |
|
|
.post( |
|
|
.post( |
|
|
`/trending/api/Signup/ReSendVerifyMail?Email=${this.userData.Email}` |
|
|
|
|
|
|
|
|
`/trending/api/Signup/ReSendVerifyMail?Email=${this.user.Email}` |
|
|
) |
|
|
) |
|
|
.then((res) => { |
|
|
.then((res) => { |
|
|
//console.log(JSON.stringify(res)); |
|
|
//console.log(JSON.stringify(res)); |
|
@ -295,34 +300,67 @@ export default { |
|
|
console.log(err); |
|
|
console.log(err); |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
Login(){ |
|
|
|
|
|
try { |
|
|
|
|
|
console.log("進入登入") |
|
|
|
|
|
const response =this.$auth.loginWith('local', { data: this.userData }); |
|
|
|
|
|
console.log("res:" + JSON.stringify(response)); |
|
|
|
|
|
if(response.data.STATUSCODE == 200){ |
|
|
|
|
|
let data = response.data.DATA; |
|
|
|
|
|
if(data.authtoken){ |
|
|
|
|
|
const authtoken = data.authtoken; |
|
|
|
|
|
console.log("頭肯:" + authtoken); |
|
|
|
|
|
this.$auth.$storage.removeUniversal('authtoken'); |
|
|
|
|
|
this.$auth.$storage.setUniversal('authtoken', authtoken); |
|
|
|
|
|
let path = that.$auth.$storage.getUniversal('userBeforePath'); |
|
|
|
|
|
if(path == "/user"){ |
|
|
|
|
|
path = "/"; |
|
|
|
|
|
} |
|
|
|
|
|
that.$router.push({path: path}); |
|
|
|
|
|
console.log("耶一成功!") |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}catch(err) { |
|
|
|
|
|
console.log(err); |
|
|
|
|
|
|
|
|
async Login(){ |
|
|
|
|
|
this.userData.Account = this.userInfo.Account; |
|
|
|
|
|
this.userData.Password = this.user.Password; |
|
|
|
|
|
console.log("登入") |
|
|
|
|
|
console.log(JSON.stringify(this.userData)); |
|
|
|
|
|
|
|
|
|
|
|
let that = this; |
|
|
|
|
|
|
|
|
|
|
|
const response = await this.$auth.loginWith('local', { data: that.userData }); |
|
|
|
|
|
console.log("我的response:" + JSON.stringify(response)); |
|
|
|
|
|
|
|
|
|
|
|
if(response.data.STATUSCODE == 200){ |
|
|
|
|
|
let data = response.data.DATA; |
|
|
|
|
|
if(data.authtoken){ |
|
|
|
|
|
const authtoken = data.authtoken; |
|
|
|
|
|
console.log("頭肯: " + authtoken); |
|
|
|
|
|
that.$auth.$storage.removeUniversal('authtoken'); |
|
|
|
|
|
that.$auth.$storage.setUniversal('authtoken', authtoken); |
|
|
|
|
|
let path = that.$auth.$storage.getUniversal('userBeforePath'); |
|
|
|
|
|
if(path == "/user"){ |
|
|
|
|
|
path = "/"; |
|
|
|
|
|
} |
|
|
|
|
|
that.$router.push({path: path}); |
|
|
|
|
|
console.log("耶一登入成功開心"); |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// this.$axios |
|
|
|
|
|
// .post( |
|
|
|
|
|
// `/trending/api/System/Login`, this.userData |
|
|
|
|
|
// ) |
|
|
|
|
|
// .then((response) => { |
|
|
|
|
|
// console.log(JSON.stringify(response)); |
|
|
|
|
|
// if(response.data.STATUSCODE == 200){ |
|
|
|
|
|
// let data = response.data.DATA; |
|
|
|
|
|
// if(data.authtoken){ |
|
|
|
|
|
// console.log("頭肯:" + data.authtoken); |
|
|
|
|
|
// const authtoken = data.authtoken; |
|
|
|
|
|
// this.$auth.$storage.removeUniversal('authtoken'); |
|
|
|
|
|
// this.$auth.$storage.setUniversal('authtoken', authtoken); |
|
|
|
|
|
// let path = this.$auth.$storage.getUniversal('userBeforePath'); |
|
|
|
|
|
// if(path == "/user"){ |
|
|
|
|
|
// path = "/"; |
|
|
|
|
|
// } |
|
|
|
|
|
// this.$router.push({path: path}); |
|
|
|
|
|
// this.$nuxt.refresh(); |
|
|
|
|
|
// //this.$router.push('/'); |
|
|
|
|
|
|
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// }) |
|
|
|
|
|
// .catch((err) => { |
|
|
|
|
|
// console.log(err); |
|
|
|
|
|
// }); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
computed: { |
|
|
computed: { |
|
|
validFormat() { |
|
|
validFormat() { |
|
|
if (this.valid && this.userData.Password === this.confirmPasswordText) { |
|
|
|
|
|
|
|
|
if (this.valid && this.user.Password === this.confirmPasswordText) { |
|
|
return true; |
|
|
return true; |
|
|
} else { |
|
|
} else { |
|
|
return false; |
|
|
return false; |
|
|