matsuijurina
2015-10-19 16:42:06 +08:00
肯定还是跨域的问题,@gamexp 是正解。解决方法在服务器端,比如 golang 就需要加这几句
w.Header().Set("Content-Type", "application/json;charset=UTF-8")
w.Header().Set("Access-Control-Allow-Origin", "*")
w.Header().Set("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT, DELETE")
w.Header().Set("Access-Control-Allow-Headers",
"Accept, Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token, Authorization")
Rails 好像改一行代码就可以了。