WeChat applet requests server address error

Error message:

{"errno":600009,"errMsg":"request:fail invalid url \"/home/swiperdata\""}

Reason for error:

1. The base address is not written

2. The base address or interface address is not written correctly, there may be more spaces or characters, etc.

3. The request method that uses third-party encapsulation is not registered in main.js

Notice:

This file needs to be introduced between new Vue() and app.$mount() of main.js in the root directory.

The reason behind new Vue() is that the external JS file needs to refer to the instance of vue, that is, the this object, which cannot be referenced until the instance is created through new in main.js. The reason before app.$mount() is to configure the request information before Vue mounts this instance (that is, initialize App.vue), so the request can also be sent normally in App.vue.

Guess you like

Origin blog.csdn.net/XiaoSen125_/article/details/129156399