Browse Source

注册国外手机号问题核实

zweizhao 7 years ago
parent
commit
71757df072
1 changed files with 6 additions and 3 deletions
  1. 6 3
      pages/user/register.vue

+ 6 - 3
pages/user/register.vue

@@ -235,16 +235,19 @@ export default {
      */
     async getVerMobile(run) {
       // let checkRes = await this.$post('')
-      let mobile = this.ruleFormPhone.mobile.split('-')[1] || ''
-      if(this.ruleFormPhone.mobile.match(/\+86/) && !mobile.match(/^(0|86|17951)?(13[0-9]|15[012356789]|166|17[3678]|18[0-9]|14[57])[0-9]{8}$/)) {
+      let mobileSplit = this.ruleFormPhone.mobile.split('-')
+      let area = mobileSplit[0] || ''
+      let mobile = mobileSplit[1] || ''
+      if(area.match(/\+86/) && !mobile.match(/^(0|86|17951)?(13[0-9]|15[012356789]|166|17[3678]|18[0-9]|14[57])[0-9]{8}$/)) {
         this.$message({
           message: '请输入正确手机号',
           type: 'error'
         })
         return
       }
+      console.log(encodeURI(area + mobile))
       let res = await this.$post('/api/passport/check_registered', {
-        mobile,
+        mobile: encodeURIComponent(area + mobile),
       })
       // console.log(res)
       if(res) {