我正在使用 CollectionFS 和 GridFS 来上传图像:
Pictures.insert(e.target.files[0], function(err, res) {
if (err) return console.log(err);
this.setState({editing: false});
});
但是上传时出现错误:
Exception in delivering result of invoking '/cfs.pictures.filerecord/insert':
TypeError: Accounts._storedLoginToken is not a function
我试过Accounts._storedLoginToken()在 Meteor shell 中调用,它给出了同样的错误。
错误发生在 Meteor 代码中:
var authToken = '';
if (typeof Accounts !== "undefined") {
var authObject = {
authToken: Accounts._storedLoginToken() || '',
};
// Set the authToken
var authString = JSON.stringify(authObject);
authToken = FS.Utility.btoa(authString);
}
任何帮助将非常感激。