我在另一个流星调用和cursor.map中有一个流星调用“ Send to all”,它在服务器端引发错误,但在客户端运行良好,以下是错误:我如何删除此错误?流星1.8反应16.8
send all numbers error2 { Error: Method 'Send to all' not found [404]
I20190720-13:08:56.527(5.5)? at Server.applyAsync (packages/ddp-server/livedata_server.js:1648:9)
I20190720-13:08:56.528(5.5)? at Server.apply (packages/ddp-server/livedata_server.js:1625:26)
I20190720-13:08:56.529(5.5)? at Server.call (packages/ddp-server/livedata_server.js:1607:17)
I20190720-13:08:56.530(5.5)? at Find all numbers.userKisandb.find.fetch.map.Mob (imports/api/userKisan.js:47:24)
I20190720-13:08:56.531(5.5)? at Array.map (<anonymous>)
I20190720-13:08:56.531(5.5)? at MethodInvocation.Find all numbers (imports/api/userKisan.js:44:21)
I20190720-13:08:56.532(5.5)? at maybeAuditArgumentChecks (packages/ddp-server/livedata_server.js:1771:12)
I20190720-13:08:56.533(5.5)? at DDP._CurrentMethodInvocation.withValue (packages/ddp-server/livedata_server.js:719:19)
I20190720-13:08:56.533(5.5)? at Meteor.EnvironmentVariable.EVp.withValue (packages\meteor.js:1234:12)
I20190720-13:08:56.534(5.5)? at DDPServer._CurrentWriteFence.withValue (packages/ddp-server/livedata_server.js:717:46)
I20190720-13:08:56.536(5.5)? at Meteor.EnvironmentVariable.EVp.withValue (packages\meteor.js:1234:12)
I20190720-13:08:56.537(5.5)? at Promise (packages/ddp-server/livedata_server.js:715:46)
I20190720-13:08:56.539(5.5)? at new Promise (<anonymous>)
I20190720-13:08:56.539(5.5)? at Session.method (packages/ddp-server/livedata_server.js:689:23)
I20190720-13:08:56.540(5.5)? at packages/ddp-server/livedata_server.js:559:43
I20190720-13:08:56.541(5.5)? isClientSafe: true,
I20190720-13:08:56.542(5.5)? error: 404,
I20190720-13:08:56.542(5.5)? reason: 'Method \'Send to all\' not found',
I20190720-13:08:56.544(5.5)? details: undefined,
I20190720-13:08:56.544(5.5)? message: 'Method \'Send to all\' not found [404]',
I20190720-13:08:56.545(5.5)? errorType: 'Meteor.Error' }
'Find all numbers' (smsText) {
if(!this.userId) {
throw new Meteor.Error('not-authorized');
}
return userKisandb.find({
userId: this.userId
}).fetch().map((Mob) => {
// return Mob.Mnumber
if(Mob.Mnumber) {
Meteor.call('Send to all',Mob.Mnumber,smsText,(err,resp) => {
//this call throws error on server side
//sms.js
if(err){
console.log("send all numbers error2", err);
} else {
console.log("send all numbers sucess", resp);
}
})
}
});
},
方法是
Meteor.methods({
'Send to all'(mob,text) {
let from = 1234;
console.log(from);
},
})