create resend otp route

This commit is contained in:
HAM!DREZA
2024-05-27 17:06:12 +03:30
parent 021360e364
commit f234440d1a
5 changed files with 148 additions and 29 deletions
+3 -5
View File
@@ -7,7 +7,7 @@
v-model="phone"
type="text"
class="loginInput"
placeholder="شماره موبایل"
placeholder="شماره موبایل خود را وارد کنید"
/>
<svg
class="h-[1.146vw] w-[1.146vw] absolute left-[1.2vw]"
@@ -34,10 +34,10 @@
<button class="greenButton w-full !mt-[1.5vw] relative" @click="login">
<span class="loader absolute" v-if="loading"></span>
<span v-else>ورود</span>
<span v-else>دریافت کد ورود</span>
</button>
<div class="backdrop-blur-sm bg-white/30 p-[1vw] rounded-[0.5vw] text-red-400 text-[0.7vw] absolute w-full" v-for="(error,index) in errors" :key="index">
<div class="backdrop-blur-sm bg-white/30 p-[1vw] rounded-[0.5vw] text-red-400 text-[0.7vw] absolute w-full -top-[10vw]" v-for="(error,index) in errors" :key="index">
<span>* {{error}}</span>
</div>
</div>
@@ -50,7 +50,6 @@ const loading = ref(false);
const FormStatus = useState("showCheckOtpForm");
async function login() {
if (phone.value == null) {
console.log("شماره موبایل الزامی است")
errors.value = []
return errors.value.push("شماره موبایل الزامی است")
}
@@ -71,7 +70,6 @@ async function login() {
phone: phone.value,
type: "1",
},
});
if (data.message === 'کد با موفقیت ارسال شد') {
const phoneNumber = useState('phoneNumber', () => phone.value)