1. Form validation (login/index.vue)

    1. utils/validate.js —> validMobile
  2. Call the API wrapped in API /user.js

    1. Get the axios instance from axios instance: utils/request.js
    2. Sets the base address from the environment variable
  3. Collect the user’s parameters and pass them to the API in the previous step. (The data item name of the collected page is the same as that in the interface)

  4. Add request header via request interceptor (add token, utils/request.js)

  5. Proxy forwarding (vue.config.js)

  6. The back-end server needs to be started and mongoDB needs to be started. The backend receives the request and returns the data

  7. Handled by the response interceptor (utils/request.js)

    1. Determine whether the current operation succeeded and whether Axios reported an error
    2. Simplify the writing of valid data (unshell)
  8. Get the result of the API call (login.vue)

  9. Save token to vuex (store/modules/user.js)

  10. Token persistence (utils/auth.js)