我的axios用户注册请求没有得到响应,但由用户创建

时间:2019-07-24 11:17:13

标签: rest asp.net-core cors axios

当我尝试注册新用户时,我会发送带有用户信息的发帖请求。结果,我应该得到新用户的ID。但是Promise不会收到来自服务器的任何请求。

我在服务器上注册了CORS:

        app.UseCors(c => c.AllowAnyOrigin()
             .AllowAnyMethod()
             .AllowAnyHeader());

邮递员正确获得结果: [enter image description here]

this.axios.post('request_link', this.user)
        .then((response) => {
          console.log(response);
          console.log('user added');
        })
        .catch(error => console.log(error));

我想获取新用户的ID,但现在没有任何请求。

0 个答案:

没有答案