是否可以在 Android Capacitor 应用程序上设置默认来源而https://example.org不是标准http://localhost?
原点由 webview 处理并取决于提供应用程序的 url,因此您不能直接更改原点,但您可以更改 url 电容器使用,这将更改原点。要更改url,请在capacitor.config.json 中配置服务器对象的hostname 和androidSchene 属性
"server": {
"hostname": "example.org",
"androidScheme": "https"
}
Run Code Online (Sandbox Code Playgroud)
https://capacitor.ionicframework.com/docs/basics/configuring-your-app#common-configuration
| 归档时间: |
|
| 查看次数: |
5690 次 |
| 最近记录: |