This is the first day of my participation in Gwen Challenge
One, foreword
Recently, I took over a project of the company, including Alipay applets and wechat applets. In the process of modification, I noticed the differences between Alipay and wechat applets, so I hereby sort them out to avoid people stepping on them.
Two, quickly identify wechat and Alipay small program
Because the title function of the company’s two-end small program interface is highly consistent, there may be a problem with one end of the small program and no problem at the other end, but also need to quickly troubleshoot the problem, so it is critical to quickly identify small programs.
Figure 1Figure 2
Figure 1 is the title bar of wechat mini program, and Figure 2 is the title bar of Alipay mini program. Shorthand wechat is point alipay is fork
Success, failure, timeout, and network status code of the request function
wx.request
Fail: occurs only when the system or network fails, such as network packet loss or domain name resolution failure. Success: As long as there is a response, even 404, 502 and other interface states will be considered as success. The request timeout period is 1 minute by default
my.request
The possible causes of fail are as follows: 1. The request is not completed and is forwarded to another page. 2. Parameter error. 3. You have no right to call this interface. 4. The network fails. 5. Time out. 6. Decoding fails. 7. Failed to transmit the parameter. HTTP error. 9. The proxy request failed. Success: Correct response In alipay mini program, the network status code is called errCode; The default timeout time of interface request in alipay mini program is 30 seconds (the default is 30 seconds, different network status is different, WIFI is 15 seconds, 4G is 20 seconds). The actual timeout time set by Android phone in the online project does not take effect.
A lot of problems
Since users have corresponding OpenID on wechat mini program and public account, they need to obtain unionID for binding. Alipay only has one AlipayUserID