【发布时间】:2020-04-06 17:56:46
【问题描述】:
是否可以在 Android Capacitor 应用上设置默认来源 https://example.org 而不是标准 http://localhost?
【问题讨论】:
是否可以在 Android Capacitor 应用上设置默认来源 https://example.org 而不是标准 http://localhost?
【问题讨论】:
origin 由 webview 处理,取决于应用程序所在的 url,因此您不能直接更改 origin,但您可以更改 url 电容器的使用,这将更改 origin。要更改 url,请在电容器.config.json 中配置服务器对象的主机名和 androidSchene 属性
"server": {
"hostname": "example.org",
"androidScheme": "https"
}
https://capacitor.ionicframework.com/docs/basics/configuring-your-app#common-configuration
【讨论】: