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 (将#修改为@)