Home > Mobile >  WeChat applet ajax cross-domain problem how to solve
WeChat applet ajax cross-domain problem how to solve

Time:09-21

I use the browser in the local operation can realize local Java structures, the background of cross-domain access to data, as shown in figure:
(right) front end:


(right) background:


Then transfer the ajax request to WeChat small program (no AppID, local debugging) on debug, at the same time the background code completely did not move, but found that the method in WeChat small programs can never achieve cross-domain,
The following problems:

Background break point at the same time, haven't received WeChat small program launched by the request,
So he caught by Charles to compare, but still can't find the problem, please help solve the great god,

The enclosed code below:

1. WeChat applet ajax request code:


2. WeChat applet ajax request Network:


3. Caught to WeChat applet ajax request:


4. (right) run browser corresponds to an ajax request caught content:


The great god, please help to take a look at this WeChat small program using ajax cross-domain request have what problem!!!!!! Very urgent, help!!!!!

CodePudding user response:

WeChat small application front end part of ajax code corrections for:

But still can not solve, can someone help to solve it, money can also help,,

CodePudding user response:

Small program can set the request to the backend localized bond? There is no cross domain,

CodePudding user response:

Your problem solved

CodePudding user response:

In this life are not seen 602 errors, or try to minimize the code line not line?

CodePudding user response:

Small program can also use ajax, I thought can only use wx. Request

CodePudding user response:

Small program must be HTTPS URL

CodePudding user response:

Small program for LAN address can access it, anyway I is done with the web address to access, didn't try
HTTP can use after closing address the validity check

CodePudding user response:

Access to small program launched in WeChat server, how is it possible to visit your 127.0.0.1? Your test server must be binding on an external network access to the address, otherwise it is not possible to access to,
  • Related