为什么我的这段代码会无限调用这个接口,成死循环

 getSmscode() {
        var reg = /^1[3|4|5|7|8][0-9]\d{8}$/
        if (this.registerInfo.phone == "") {
            this.$message({
                message: "请输入手机号码",
                type: "warning"
            });
        } else if (!reg.test(this.registerInfo.phone)) {
            this.$message({
                message: "号码格式不正确",
                type: "warning"
            });
        } else {
            this.fromdataSmscode.append("phone", this.registerInfo.phone);
            this.$axios.post(url.sendSMS, this.fromdataSmscode).then(response => {
                    console.log(response);
                    this.$message({
                        message: "发送成功,请注意查收",
                        type: "success"
                    })
                    this.getCode()
                    
                })
                .catch(response => {
                    console.log(response);
                    this.$message(response.data.errorMessage);
                })
        }
    }
阅读 2k
1 个回答
                    return  this.$message({                   
                        message: "请输入手机号码",
                        type: "warning"
                     });
推荐问题