问题描述
我使用nativescript-vue和axios开发了一个应用程序。我正在使用来自android studio的android模拟器。
因此我的应用程序上周运行正常,因为我们进行了此检查。现在,我想对此应用程序进行更新,但是当我尝试登录时,它返回空的result.data
和空的result.status
我尝试在Postman中检查它,以查看错误是否在api中,但其工作正常:
这是控制台axios的结果:
这是我的方法:
感谢任何帮助我指出正确方向的帮助。谢谢。
解决方法
如果您正在等待axios调用,请使用以下语法:
const response = await axios.post({ method:POST,url:'someUrl',data:'somedata' },newPost);
,然后记录响应变量以查看是否有效。
,我也面临这个问题,添加
android:usesCleartextTraffic="true"
我的AndroidManifest.xml
解决了这个问题。
<application
android:usesCleartextTraffic="true"
android:name="com.tns.NativeScriptApplication"
android:allowBackup="true"
android:icon="@drawable/icon"
android:label="@string/app_name"
android:theme="@style/AppTheme">
....
<application>