Reactjs 脚本资源位于不允许的重定向后面。firebase云消息传递

Reactjs 脚本资源位于不允许的重定向后面。firebase云消息传递,reactjs,firebase,firebase-cloud-messaging,Reactjs,Firebase,Firebase Cloud Messaging,您好,从过去一个月起,我们的firebase应用程序开始出现此错误。 脚本资源位于不允许的重定向后面 我们已经在服务器的根目录下注册了firebase-messaging-sw.js,它也会在浏览器中打开。同样的代码在localhost中非常有效,但在公共域(cloudflare dNS)中会出现此错误 已经尝试过此处提到的解决方案: 我们的现行守则: messaging = firebase.messaging(); $this

您好,从过去一个月起,我们的firebase应用程序开始出现此错误。 脚本资源位于不允许的重定向后面 我们已经在服务器的根目录下注册了firebase-messaging-sw.js,它也会在浏览器中打开。同样的代码在localhost中非常有效,但在公共域(cloudflare dNS)中会出现此错误

已经尝试过此处提到的解决方案:

我们的现行守则:

                messaging = firebase.messaging();
                $this.setState({messaging});
                messaging.useServiceWorker(registration);
                messaging.requestPermission().then(function() {

                    $this.setState({permission:true});
                    messaging.getToken().then(function(currentToken) {
                        $this.setState({fcmtoken:currentToken});

                        resolve(currentToken);
                    });
                });
            });
firebase-messaging-sw.js内容:

        importScripts("https://www.gstatic.com/firebasejs/5.3.0/firebase-messaging.js");
         var config = {
          apiKey: "AIzxxxxxxxxxxxxxx0",
          authDomain: "noxxxxions-7xxxd.firebaseapp.com",
          databaseURL: "https://notifications-76xxxxd.firebaseio.com",
          projectId: "nxxxxxxxxxxd",
          storageBucket: "notifixxxxxx.appspot.com",
          messagingSenderId: "90000000000"
        };
        firebase.initializeApp(config);
        var messaging = firebase.messaging();


        messaging.setBackgroundMessageHandler(function(payload) {

          var notificationTitle = "Background Message Title";
          var notificationOptions = {
            body: "Background Message body.",
            icon: "/firebase-logo.png"
          };

          return self.registration.showNotification(notificationTitle,
            notificationOptions);
        });```

单击该链接会导致重定向


如果您尝试重定向url,例如:而不是单击该链接导致重定向,该怎么办


如果您尝试使用重定向的url,例如:而不是

更改的url,您可以建议有关此问题的任何解决方案吗?更改的url您可以建议有关此问题的任何解决方案吗?有人可以帮助我们解决此问题吗?有人可以帮助我们解决此问题吗?