【发布时间】:2018-12-31 11:25:13
【问题描述】:
我无法在我的 CollectionFS 集合中显示图像。 控制台告诉我资源不可用,错误是 503 错误。
我正在使用流星版本 1.6.1.1
我不知道为什么无法访问这些图像。 我查看了这里的各种帖子,但没有一个涉及 Meteor 和 ReactJS。
任何帮助将不胜感激。
xport default class Home extends Component {
constructor(props){
super()
this.profileImage = this.getProfileImage()[0]
window.profileImage = this.profileImage
}
getProfileImage(){
return Images.find().fetch()
}
render(){
console.log(this.profileImage.url({store:"images",uploading: "./user.jpg"}))
return(
<div>
<div className="row">
<div className="flex-container">
<div className="flex-child">
<img src={FlowRouter.subsReady('images') ? this.profileImage.url({store:"images",uploading: "./user.jpg",auth: false}) : "./user.jpg" } className="img-responsive" id="home-profilepic" alt=""/>
</div>
<div className="flex-child">
<h4 className="bold" id="home-firstandlast">
{FlowRouter.subsReady('userData') ? Meteor.user().profile.firstAndLastName : 'Loading'}
</h4>
<p id="home-username" className="bold">
{FlowRouter.subsReady('userData') ? Meteor.user().username : 'Loading'}
</p>
<p id="home-bio">
{FlowRouter.subsReady('userData') ? String(Meteor.user().profile.bio) : 'Loading'}
</p>
</div>
</div>
</div>
<br/>
<div className="border"></div>
<br/>
<div className="row">
<div className="flex-container center-text">
<div>
<p className="bold">Followers</p>
<p>
{FlowRouter.subsReady('userData') ? String(Meteor.user().profile.contacts.followers.length) : 'Loading'}
</p>
</div>
<div>
<p className="bold">Following</p>
<p>
{FlowRouter.subsReady('userData') ? String(Meteor.user().profile.contacts.following.length) : 'Loading'}
</p>
</div>
<div>
<p className="bold">Podcasts</p>
<p>20</p>
</div>
</div>
</div>
</div>
)
}
}
我的包裹如下:
cfs:standard-packages
cfs:gridfs
cfs:filesystem
【问题讨论】:
标签: reactjs meteor collectionfs