vue formData请求


  • new 一个formData实例

 import axios from 'axios'
<script>
  let newdata = new FormData();
      newdata.append('username', this.form.username);
      newdata.append('password', this.form.password);
      console.log(newdata.get('username'));
      console.log(newdata.get('password'));
      axios.post('http://192.168.0.1/v1/xxx/login/do', newdata).then(res => {
         console.log(res);
      })
</script>

你可能感兴趣的:(vue.js,axios,post,formData)