最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

vue實(shí)現(xiàn)通過手機(jī)號(hào)發(fā)送短信驗(yàn)證碼登錄的示例代碼

 更新時(shí)間:2022年05月26日 09:33:14   作者:夏暖冬涼  
本文主要介紹了vue實(shí)現(xiàn)通過手機(jī)號(hào)發(fā)送短信驗(yàn)證碼登錄的示例代碼,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧

本文主要介紹了vue實(shí)現(xiàn)通過手機(jī)號(hào)發(fā)送短信驗(yàn)證碼登錄的示例代碼,分享給大家,具體如下:

<template>
    <div class="get-mobile" @touchmove.prevent>
        <div class="main">
            <div class="pt-20 pr-15 pl-15 pb-20">
                <input class="input mb-15" v-model="form.tel" placeholder="請(qǐng)輸入手機(jī)號(hào)" type="number">
                <div class="box">
                    <input class="input" v-model="form.telVerificationCode" placeholder="請(qǐng)輸入短信驗(yàn)證碼" type="number">
                    <div class="el-button" @click="send">{{ countDown }}</div>
                </div>
            </div>
            <div class="btn" @click="sumbit">提交</div>
        </div>
    </div>
</template>

<script>
import { sendLoginMsgCode, login } from 'xx';

export default {
    name: 'GetMobile',
    data() {
        return {
            form: {
                telVerificationCode: '',
                tel: '',
            },
            countDown: "發(fā)送驗(yàn)證碼", // 倒計(jì)時(shí)
            bVerification: false // 節(jié)流
        }
    },
    methods: {
        async sumbit() {
            const { telVerificationCode, tel } = this.form
            if (!telVerificationCode || !tel) return this.$toast("請(qǐng)輸入手機(jī)號(hào)和驗(yàn)證碼");
            let { code, data } = await login({
                tel,
                telVerificationCode,
                isOffline: false
            });
            if (code === 200) {
                this.$toast('登錄成功');
                this.$emit('sumbit', data.userInfo);
                this.$emit('update:dialog', false)
            }
        },
        async send() {
            if (!/^\d{11}$/.test(this.form.tel)) return this.$toast("請(qǐng)先輸入正確的手機(jī)號(hào)");
            if (this.bVerification) return;
            this.bVerification = true;
            const { code } = await sendLoginMsgCode({
                tel: this.form.tel
            });
            if (code === 200) {
                this.$toast("發(fā)送驗(yàn)證碼...");
            }
            let countDown = 59;
            const auth_time = setInterval(() => {
                this.countDown = countDown--;
                if (this.countDown <= 0) {
                    this.bVerification = false;
                    this.countDown = "發(fā)送驗(yàn)證碼";
                    clearInterval(auth_time);
                }
            }, 1000);
        }
    }
}
</script>

<style lang='scss' scoped>
.get-mobile {
    height: 100vh;
    width: 100vw;
    background-color: rgba(0, 0, 0, .6);
    display: flex;
    justify-content: center;
    align-items: center;

    .main {
        width: 280px;
        height: 178px;
        background: #FFFFFF;
        border-radius: 5px;

        .input {
            border: 1px solid #EBEBEF;
            border-radius: 5px;
            height: 40px;
            padding-left: 10px;
        }

        .el-button {
            margin-left: 10px;
            border-radius: 5px;
            background: #5F93FD;
            color: #fff;
            width: 140px;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .btn {
            height: 45px;
            color: #5F93FD;
            display: flex;
            justify-content: center;
            align-items: center;
            border-top: 1px solid #EBEBEF;
        }
    }
}
</style>

到此這篇關(guān)于vue實(shí)現(xiàn)通過手機(jī)號(hào)發(fā)送短信驗(yàn)證碼登錄的示例代碼的文章就介紹到這了,更多相關(guān)vue 驗(yàn)證碼登錄內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • uniapp?獲取系統(tǒng)信息的方法小結(jié)

    uniapp?獲取系統(tǒng)信息的方法小結(jié)

    uni-app提供了異步(uni.getSystemInfo)和同步(uni.getSystemInfoSync)的2個(gè)API獲取系統(tǒng)信息,系統(tǒng)信息返回的內(nèi)容非常多,各操作系統(tǒng)、各家小程序、各瀏覽器對(duì)它們的定義也不相同
    2022-11-11
  • vue.js項(xiàng)目打包上線的圖文教程

    vue.js項(xiàng)目打包上線的圖文教程

    下面小編就為大家分享一篇vue.js項(xiàng)目打包上線的圖文教程,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧
    2017-11-11
  • 如何在ElementUI的上傳組件el-upload中設(shè)置header

    如何在ElementUI的上傳組件el-upload中設(shè)置header

    這篇文章主要介紹了如何在ElementUI的上傳組件el-upload中設(shè)置header,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2022-09-09
  • Vue + Element UI圖片上傳控件使用詳解

    Vue + Element UI圖片上傳控件使用詳解

    這篇文章主要為大家詳細(xì)介紹了Vue + Element UI圖片上傳控件的使用方法,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2019-08-08
  • Vue之定義全局工具類問題

    Vue之定義全局工具類問題

    這篇文章主要介紹了Vue之定義全局工具類問題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2023-05-05
  • 關(guān)于Vue中使用alibaba的iconfont矢量圖標(biāo)的問題

    關(guān)于Vue中使用alibaba的iconfont矢量圖標(biāo)的問題

    這篇文章主要介紹了Vue使用alibaba的iconfont矢量圖標(biāo)的問題,本文通過實(shí)例代碼給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2021-12-12
  • vue+vue-fullpage實(shí)現(xiàn)整屏滾動(dòng)頁面的示例代碼(直播平臺(tái)源碼)

    vue+vue-fullpage實(shí)現(xiàn)整屏滾動(dòng)頁面的示例代碼(直播平臺(tái)源碼)

    這篇文章主要介紹了vue+vue-fullpage實(shí)現(xiàn)整屏滾動(dòng)頁面,本文通過示例代碼給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2022-06-06
  • Vue?響應(yīng)式系統(tǒng)依賴收集過程原理解析

    Vue?響應(yīng)式系統(tǒng)依賴收集過程原理解析

    Vue 初始化時(shí)就會(huì)通過 Object.defineProperty 攔截屬性的 getter 和 setter ,為對(duì)象的每個(gè)值創(chuàng)建一個(gè) dep 并用 Dep.addSub() 來存儲(chǔ)該屬性值的 watcher 列表,這篇文章主要介紹了Vue?響應(yīng)式系統(tǒng)依賴收集過程分析,需要的朋友可以參考下
    2022-06-06
  • 詳解Nuxt.js Vue服務(wù)端渲染摸索

    詳解Nuxt.js Vue服務(wù)端渲染摸索

    本篇文章主要介紹了詳解Nuxt.js Vue服務(wù)端渲染摸索,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧
    2018-02-02
  • vue+openlayers+nodejs+postgis實(shí)現(xiàn)軌跡運(yùn)動(dòng)效果

    vue+openlayers+nodejs+postgis實(shí)現(xiàn)軌跡運(yùn)動(dòng)效果

    使用postgres(postgis)數(shù)據(jù)庫以及nodejs作為后臺(tái),vue和openlayers做前端,openlayers使用http請(qǐng)求通過nodejs從postgres數(shù)據(jù)庫獲取數(shù)據(jù),這篇文章主要介紹了vue+openlayers+nodejs+postgis實(shí)現(xiàn)軌跡運(yùn)動(dòng),需要的朋友可以參考下
    2024-05-05

最新評(píng)論

日喀则市| 正安县| 高要市| 潞西市| 蒲江县| 静宁县| 四川省| 商城县| 天峻县| 蓬安县| 兴安县| 惠州市| 铁力市| 新闻| 米泉市| 中宁县| 商城县| 杨浦区| 苗栗市| 台江县| 温州市| 岢岚县| 济阳县| 江安县| 东乡| 尤溪县| 福建省| 富宁县| 汤原县| 景德镇市| 石棉县| 日喀则市| 神木县| 永康市| 沐川县| 乐都县| 布尔津县| 彰化市| 肃宁县| 崇信县| 侯马市|