科尔多瓦window.location.reload()无法正常运行

时间:2020-07-09 18:06:41

标签: javascript android angular typescript cordova

我有一个Cordova应用程序,我需要使用以下功能重新加载屏幕:

loginThisAccount(a) {
  this.login2Service.getNewToken(a).subscribe(data => {
    setTimeout(t => { window.location.reload(true); });
  });
}

但是,这给了我这个问题,就像没有文件

enter image description here

这是我的 config.xml

<?xml version='1.0' encoding='utf-8'?>
<widget id="dt.monitoring" android-versionCode="201019" version="1.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
  <name>My App</name>
  <description>
      debug app
  </description>
  <author email="support@debugapp.com">
      debug app
  </author>
  <content src="index.html" />
  <plugin name="cordova-plugin-whitelist" spec="1" />
  <access origin="*"/>
  <access origin="tel:*" launch-external="yes"/>
  <allow-navigation href="*"/>
  <allow-navigation href="http://*/*"/>
  <allow-navigation href="https://*/*"/>
  <allow-navigation href="data:*"/>
  <allow-intent href="*"/>
  <access origin="*"/>
  <allow-intent href="http://*/*" />
  <allow-intent href="https://*/*" />
  <allow-intent href="tel:*" />
  <allow-intent href="sms:*" />
  <allow-intent href="mailto:*" />
  <allow-intent href="geo:*" />
  <platform name="android">
      <allow-intent href="market:*" />
  </platform>
  <platform name="ios">
      <allow-intent href="itms:*" />
      <allow-intent href="itms-apps:*" />
  </platform>
</widget>

在我的index.html中,我有这个

<!doctype html>
<html>
  <head>
    <base href="./">
    <script type="text/javascript" src="cordova.js"></script>

如果有帮助,我正在使用angular v4生成此应用。

0 个答案:

没有答案