我正在使用 angularjs 指令进行 facebook 共享。
angularjs 指令控制器,我正在加载 facebook javascript sdk。angularjs 指令链接功能,我正在显示登录,登录后,我正在显示共享对话框。
link : function(scope, element, attrs){
scope.share = function(){
FB.ui(
{
method: 'feed',
name: attrs.fbName,
caption: attrs.fbCaption,
description: attrs.fbDescription,
link: $location.absUrl(),
picture: 'http://www.fbrell.com/public/f8.jpg'
},
function(response) {
if (response && response.post_id) {
alert('Post was published successfully.');
} else {
alert('Post was not published.');
}
}
)
}
element.bind('click', function(){
FB.getLoginStatus(function(response) {
if (response.status === 'connected') {
scope.share();
} else if (response.status === 'not_authorized') {
alert("user is not authorized ");
} else {
FB.login(function(response) {
if (response.authResponse) {
scope.share();
} else {
alert("please login first");
}
});
}
});
});
}
它在 firefox 中工作,但在 chromium 中,它不工作。它给出 HTTP 500 ok 错误。
我已经搜索了很多,发现它是服务器端错误。如何解决它或者我应该怎么做才能解决它?