Vue's vue-resource, uses jsonp to call the interface to return an error, and the browser can get the data. Why?

getanci(data) {
      this.$http.jsonp("http://data1.library.sh.cn/gj/webapi/instances", {
        params: {
          key: "xxxx",
          title: ""
        }
      },
      {}).then((response) => {
        console.log(response)
      })
        .catch(err => {
          console.log(err)
        })
    }
//          http://data1.library.sh.cn/gj/webapi/instances?title=%E4%B8%89%E5%9B%BD&key=xxxx
//  vue        http://data1.library.sh.cn/gj/webapi/instances?title=%E4%B8%89%E5%9B%BD&key=xxxx&callback=_jsonpfda1ln7gros

what is the reason for Technical Daniel and how to modify it

Mar.21,2021

are you sure this product supports jsonp?
jsonp should return

callbackName({json: {}});

essentially returns the javascript code, which is the same as the basic principle of the module baler.

but this product returns a json string, does not support the function name of callback, you can not get the content.
this requirement backend acts as a proxy.

Menu