var stream = weex.requireModule('stream')
export default {
data () {
return {
myimg:'unknown'
}
},
methods: {
getStarCount (repo, callback) {
return stream.fetch({
method: 'GET',
type: 'json',
url: 'https://c.sevenkids.cn/yzmm/account/knowledge/ajaxOpenSerachKnowledgeList'
}, callback)
}
},
created () {
this.getStarCount('11', res => {
this.myimg = res.ok ?JSON.stringify(res):JSON.stringify(res)
})
}
}
这是请求头:
Referer http://dotwe.org/raw/htmlVue/...
User-Agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/602.4.8 (KHTML, like Gecko) Version/10.0.3 Safari/602.4.8
Origin http://dotwe.org
返回结果:
{"status":-1,"ok":false,"statusText":"","data":""}
是这里引用的‘stream’ 需要自己实现吗?
var stream = weex.requireModule('stream')
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…