检查客户端上的参数:
'click div[name="saveCollection"]' : function(e) {
var title = 'Title'
var description = 'Description'
check(title, String)
check(description, String)
Match.test(title, String) --> It's true
Match.test(description, String) --> It's also true
Meteor.call('saveCollection', title, description, function(error, result){
...
})
}
检查服务器上的参数:
saveCollection: function (title, description) {
check(title, String)
check(description, String)
Match.test(title, String) --> It's true
Match.test(description, String) --> It's also true
Collection.insert({
title: title,
description: description
})
}
Exception while invoking method 'saveCollection' Error: Did not check() all arguments during call to 'saveCollection'
我做错了什么?
答案 0 :(得分:0)
正如评论所说,你不打算打电话
Meteor.call('saveCollection', title, description)
而不是
Meteor.call('saveCollection', description, description)
这可能搞砸了审计参数检查。