本文介绍了Yammer JS SDK - CORS的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

似乎在Yammer端有所改变,因为我的应用程序(尚未发布到Yammer全球应用程序目录)已停止工作,导致一个模糊的CORS错误,不告诉一个问题的事情。

It seems like something has changed on the Yammer side, because my app (not yet published to the Yammer Global App Directory) has stopped working, resulting in an obscure CORS error, that doesn't tell a thing about the problem.

所以工作流程非常简单 -

So the workflow is very simple —


  • 是通过调用 getLoginStatus()(弹出一个窗口并立即关闭它,激怒,但可以生存的)登录

  • 按照建议将请求发送到包含在 yam.platform.request 中的 messages / in_group / ID.json

  • I'm ensuring that user is logged in by calling getLoginStatus() (which pops-up a window and immediately closes it. Irritating, but can live with that)
  • Sending a request to messages/in_group/ID.json wrapped in a yam.platform.request, as suggested by the Yammer JS SDK manual

这是控制台屏幕截图:

img src =https://i.stack.imgur.com/MJ6E9.pngalt =enter image description here>

在Yammer应用程式设定中一个单独的Javascript源,它是 https://buzztale.com ,这正是一个,请求是从。

In the Yammer App settings there's a single Javascript Origin, which is https://buzztale.com, which is exactly the one, the request is made from.

这发生了,但后来消失了(真的很混乱)。现在似乎回来了...

This happened before, but then disappeared itself (really confusing). And now it seems to be back…

希望有人对这个问题有任何建议。要访问应用,请访问以下网址:。 p>

Hope somebody has any suggestions regarding this issue. In order to get to the app, here's the URL — https://buzztale.com/yammer.

推荐答案

这里我的开发应用程序在今天的某个时候开始失败。
看起来所有的登录端点都正常工作,但是消息源给我CORS错误。

Same here my dev app started failing sometime today.It seems that all of the login end points are working as expected however the messages feed is giving me CORS errors.

yam.platform.request({
            url: "https://api.yammer.com/api/v1/messages/my_feed.json",
            method: "GET",
            success: function (user) { //print message response information to the console
              console.log("The request was successful." + user.messages);
            },
            error: function (user) {
              console.log("There was an error with the request.");
            }
        });

这篇关于Yammer JS SDK - CORS的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 04:08