是这个样子的
vue+vue-resource+express组合
然后在下面这里遇到问题了
client
this.$http.jsonp('http://localhost:3300/register', { params: { name: this.name, password: this.password, repassword: this.repassword } }, {})
.then(function (response) {
console.log(response.data.state)
})
server
app.get('/register', function (req, res) {
userTools.create(user).then(function(result){
res.jsonp(result)
}).catch(function(err){
res.jsonp(data)
})
})
这样就会出错
如果server改为下面这样就不出包错了
app.get('/register', function (req, res) {
res.jsonp(data)
}
这是问什么啊?
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
应该是sever代码有问题吧,看下server那块是不是有报错