相信这种情况很多的吧,我遇到的情况是因为在作reSource的service时,query出来的协议不对.
错误时候的代码:
Version.factory("versionSrv", [‘$resource‘, function ($resource) { return $resource( "http://127.0.0.1:8000/server_api/version_api/:Id", {Id: "@Id" }, {update: {method: "PUT"}} ); }]);
正确的时候:
prismVersion.factory("versionSrv", [‘$resource‘, function ($resource) { return $resource( "http://127.0.0.1:8000/server_api/version_api/:Id", {Id: "@Id" }, {‘query‘: {method: ‘GET‘ }}, {update: {method: "PUT"}} ); }]);
错误的截图:
时间: 2024-10-08 15:27:57