如何解决将 nativescripte vue 应用程序连接到本地主机服务器
我有 Laravel 应用程序作为服务器,我正在尝试将它连接到模拟器(同一台机器)上的原生脚本 vue 应用程序。
当我使用外部 api 时,它工作得很好,但是当使用我的 api 时,它无法连接:
axios({ method: "GET","url": "http://127.0.0.1:8000/api/posts" }) .then(result => { this.posts = result.data ; },error => { console.error(error); });
还有
axios({ method: "GET","url": "http://10.0.2.2:8000/api/posts" }) .then(result => { this.posts = result.data ; },error => { console.error(error); })
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。