Home > Article > Web Front-end > How to solve the uniapp login error prompt problem
Solutions to uniapp login error prompts: 1. Modify the appid appsecret in the configuration file; 2. Set the package name of the WeChat open platform to be the same as when packaging; 3. Use the signature acquisition tool provided by WeChat to obtain the signature; 4. , Reinstall WeChat and test again.
The operating environment of this tutorial: windows7 system, uni-app2.5.1 version, Dell G3 computer.
Recommendation (free): uni-app tutorial
Specific question:
WeChat login prompt login failed
After packaging, the WeChat login prompts that the login failed. The authorization page can be jumped. After the user clicks to confirm the authorization, he returns to the APP and directly prompts that the login failed. There is no success or failure. The following is the code, signature and The registration is correct, and there are no problems with appid and appsecret
uni.login({ provider: 'weixin', success: (res) => { uni.showToast({ title: '登陆成功' }); }, fail: (res) => { /* uni.showModal({ title: '登陆失败', content: encodeURIComponent(JSON.stringify(res)), }) */ uni.showToast({ title: '登陆失败123', icon: 'none' }) } })
Solution:
Every developer needs to pay attention
Configuration file modification appid appsecret
The package name of WeChat Open Platform must be the same as when packaging.
The signature of WeChat Open Platform is generally 59201cf6589202cb2cdab26752472112. You need to obtain the specific information by yourself. Use the signature acquisition tool provided by WeChat to obtain the specific information. See https://blog.csdn.net/m00123456789/article/details/56481656
The WeChat cache problem is also a headache. After the test fails, you need to reinstall WeChat and test again, because WeChat will cache your appid. and appsecret, causing errors to occur every time you test
The above is the detailed content of How to solve the uniapp login error prompt problem. For more information, please follow other related articles on the PHP Chinese website!