lushuncheng 6 vuotta sitten
vanhempi
commit
eb37639023
2 muutettua tiedostoa jossa 9 lisäystä ja 12 poistoa
  1. 2 0
      components/input/ver.vue
  2. 7 12
      pages/user/register.vue

+ 2 - 0
components/input/ver.vue

@@ -38,6 +38,8 @@ export default {
   mounted() {},
   methods: {
     run() {
+      console.log("running+++++++++");
+      console.log(this.running);
       if (this.running) return;
       this.$emit("click", () => {
         this.running = true;

+ 7 - 12
pages/user/register.vue

@@ -194,13 +194,13 @@ export default {
       let mobile = this.ruleFormPhone.mobile;
       let register = async body => {
         if (this.isRegistering) {
-          console.log('防抖中。。。')
-          return
+          console.log("防抖中。。。");
+          return;
         }
-        this.isRegistering = true
-        setTimeout(()=>{
-          this.isRegistering = false
-        }, 1500)
+        this.isRegistering = true;
+        setTimeout(() => {
+          this.isRegistering = false;
+        }, 1500);
         let res = await this.$axios.$post("/api/passport/register", body);
         if (res && res.data) {
           this.$message.success(res.info);
@@ -249,12 +249,7 @@ export default {
       let mobileSplit = this.ruleFormPhone.mobile.split("-");
       let area = mobileSplit[0] || "";
       let mobile = mobileSplit[1] || "";
-      if (
-        area.match(/\+86/) &&
-        !mobile.match(
-          /^[0-9]{11}$/
-        )
-      ) {
+      if (area.match(/\+86/) && !mobile.match(/^[0-9]{11}$/)) {
         this.$message({
           message: "请输入正确格式的手机号",
           type: "error"