angular2 $http post请求报400错误,但$.post发送请求正常

参数与后台要求一致,也是post请求,服务端解决跨域问题用的cors。报400错误。如下
图片描述

发送请求的代码在server.ts文件中,如下:

   getMyGroups: function(userId: string, type: string) {
                return $http({
                    method: "post",
                    url: serverBaseUrl + "/message/getGroup.do",
                    data:{
                        tsId: userId,
                        type: type
                    }
                });
            },

求大神指点

阅读 4.6k
1 个回答
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进