ali 3 år sedan
förälder
incheckning
a4cf516ccc
2 ändrade filer med 9 tillägg och 7 borttagningar
  1. 2 2
      src/api/models/Auth.js
  2. 7 5
      src/components/other/VerifyMobileNumber.vue

+ 2 - 2
src/api/models/Auth.js

@@ -9,7 +9,7 @@ export default class AuthAPI extends APIRepository {
       login: '/uma/users/login',
       sendOtp: '/uma/users/send_otp',
       signUp: '/uma/users/sign_up',
-      verify: '/uma/users/verify',
+      verify: '/uma/users/verify_input',
       setPass: '/uma/users/set_password',
 
       loginAdmin: '/auth/login',
@@ -84,7 +84,7 @@ export default class AuthAPI extends APIRepository {
     return this.sendRequest({
       apiMethod: 'put',
       api: this.api,
-      request: this.APIAdresses.sendOtp,
+      request: this.APIAdresses.verify,
       data: this.getNormalizedSendData({
         input: '', // String
         otp: '' // String

+ 7 - 5
src/components/other/VerifyMobileNumber.vue

@@ -71,7 +71,7 @@
 </template>
 
 <script>
-import API_ADDRESS from 'src/api/Addresses.js'
+import { APIGateway } from 'src/api/APIGateway.js'
 
 export default {
   name: 'VerifyMobileNumber',
@@ -150,13 +150,15 @@ export default {
     },
     sendOtp () {
       if (!this.textInput) {
+        this.$q.notify({
+          type: 'negative',
+          message: 'شماره همراه خود را وارد کنید.'
+        })
         return
       }
       this.mobileNumber = this.textInput
       this.loading = true
-      this.$axios.post(API_ADDRESS.auth.sendOtp, {
-        input: this.mobileNumber
-      })
+      APIGateway.auth.sendOtpVerify({ input: this.mobileNumber })
         .then(() => {
           this.loading = false
           this.message = 'کد تایید به شماره ' + this.mobileNumber + ' ارسال شد.'
@@ -178,7 +180,7 @@ export default {
       this.message = ''
       this.otpValue = this.textInput
       this.textInput = ''
-      this.$axios.put(API_ADDRESS.user.verify, {
+      APIGateway.auth.verify({
         input: this.mobileNumber,
         otp: this.otpValue
       })