微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Ionic API请求使用远程API URL在localhost:8100之前添加

如何解决Ionic API请求使用远程API URL在localhost:8100之前添加

API请求为:http://etaqeem.com/qran/oauth/token,但是在浏览器中运行时,URL更改为URL:http:// localhost:8100 / etaqeem.com / qran / oauth / token。

login (user: any)
  {
    let request = {
      'grant_type': 'password','client_id': Service.passport.client_id,'client_secret': Service.passport.client_secret,'username': user.email,'password': user.password,}
    console.log(`${Service.url}/oauth/token`)
    return this.http.post(`${Service.url}/oauth/token`,request).toPromise();
  }

Service.url更改为http://etaqeem.com/qran。我不知道localhost:8100如何追加到URL。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。