Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Vue.js Snotify-在异步模式下触发多个调用_Javascript_Vue.js_Vuejs2_Async Await_Axios - Fatal编程技术网

Javascript Vue.js Snotify-在异步模式下触发多个调用

Javascript Vue.js Snotify-在异步模式下触发多个调用,javascript,vue.js,vuejs2,async-await,axios,Javascript,Vue.js,Vuejs2,Async Await,Axios,下面是我用来使用axios调用远程调用的代码,它基于向用户显示的服务器错误或成功通知中的错误类型。这是给原始文件的一封信 async getResponseFromServer() { if (this.errors.all().length == 0) { this.$snotify.clear(); this.$snotify.async( "Getting Data", "Loading...", () =>

下面是我用来使用axios调用远程调用的代码,它基于向用户显示的服务器错误或成功通知中的错误类型。这是给原始文件的一封信

async getResponseFromServer() {
  if (this.errors.all().length == 0) {
    this.$snotify.clear();

    this.$snotify.async(
      "Getting Data",
      "Loading...",

      () =>
        new Promise((resolve, reject) => {
          return this.getDataCommonResponse()
            .then(function(response) {
              if (response.status && response.type == undefined) {
                resolve({
                  title: response.error,
                  body: "This is the balance",
                  config: {
                    closeOnClick: true,
                    position: SnotifyPosition.centerTop
                  }
                });
              } else {
                reject({
                  title: "Error",
                  body: response.error,
                  config: {
                    closeOnClick: true,
                    position: SnotifyPosition.centerTop
                  }
                });
              }
            })
            .catch(function(error) {});
        })
    );
  }
}
在GitHub中还有一个。它说Snotify将发出2个API调用,但会发出多个请求。有没有办法限制一个API调用

有办法解决这个问题吗