[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: GuestVerifyComponent.vue
<template> <LoadingComponent :props="loading"/> <section class="pt-8 pb-16"> <div class="container max-w-[360px] py-6 p-4 sm:px-6 shadow-xs rounded-2xl bg-white"> <h2 class="capitalize mb-6 text-center text-[22px] font-semibold leading-[34px] text-heading"> {{ $t('label.verify_number') }} </h2> <form @submit.prevent="save"> <label class="text-sm first-letter:uppercase mb-1 text-heading"> {{ $t('label.enter_the_code_sent_to') }} <span class="font-medium">{{ props.form.code + '' + props.form.phone }}</span> </label> <input type="text" v-model="props.form.token" class="w-full h-12 rounded-lg border px-4 border-[#D9DBE9]"> <small class="db-field-alert" v-if="errors">{{ errors }}</small> <br> <button @click.prevent="resendCode" type="button" class="capitalize mt-2 mb-6 text-xs font-medium transition text-primary hover:underline"> {{ $t('button.resend_code') }} </button> <button type="submit" class="w-full h-12 text-center capitalize font-medium rounded-3xl text-white bg-primary"> {{ $t('label.continue') }} </button> </form> </div> </section> </template> <script> import alertService from "../../../services/alertService"; import LoadingComponent from "../components/LoadingComponent"; export default { name: "GuestVerifyComponent", components: {LoadingComponent}, data() { return { loading: { isActive: false, }, props: { form: { phone: "", token: "", code: "", }, }, errors: '', }; }, computed: { carts: function () { return this.$store.getters['frontendCart/lists']; } }, mounted() { this.phoneChecking(); }, methods: { phoneChecking: function () { const otp = this.$store.getters['GuestSignup/phone']; if (Object.keys(otp).length > 0) { this.props.form.phone = otp.otp.phone; this.props.form.code = otp.otp.code; } else { this.$router.push({name: 'auth.guestLogin'}); } }, resendCode: function () { try { this.loading.isActive = true; this.$store.dispatch("GuestSignup/otp", this.props.form).then((res) => { this.loading.isActive = false; this.errors = ''; alertService.success(res.data.message, 'bottom-center'); }).catch((err) => { this.loading.isActive = false; this.errors = err.response.data.errors; }); } catch (err) { this.loading.isActive = false; alertService.error(err); } }, save: function () { try { this.loading.isActive = true; this.$store.dispatch("GuestLoginVerify", this.props.form).then((LoginRes) => { this.$store.dispatch("GuestSignup/reset").then().catch(); this.loading.isActive = false; this.props.form = { phone: "", code: "", }; this.errors = ''; alertService.success(LoginRes.data.message); if (this.carts.length > 0) { this.$router.push({name: "frontend.checkout"}); } else { this.$router.push({name: "frontend.home"}); } }).catch((err) => { this.loading.isActive = false; this.errors = err.response.data.message; }) } catch (err) { this.loading.isActive = false; alertService.error(err); } }, }, } </script>
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.7 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002