平时在浏览器开发调试数据一般都是没问题的,在打包到手机上的时候往往会出现各种问题,记录下以后备用,也为后人提供一点参考
1.访问后端接口404异常
首先确保在浏览器能正常访问接口,现在框架基本都有用户权限,一般需要对接口进行过滤,那么为什么打包到手机就容易出现404异常呢
最终在stackoverflow找到了答案:https://stackoverflow.com/questions/30161952/ionic-angular-how-to-avoid-the-404-not-found-from-cache-after-post-reque
解决方案:
ionic cordova plugin remove cordova-plugin-whitelist
ionic cordova plugin add cordova-plugin-whitelist