我无法使用Linkedin登录我的应用程序,我看到模式链接对话框"哦哦!" 该怎么办?为什么不工作OUauth?
function onLinkedInLoad() {
IN.Event.on(IN, "auth", function() {onLinkedInLogin();});
IN.Event.on(IN, "logout", function() {onLinkedInLogout();});
}
function onLinkedInLogin() {
IN.API.Profile("me")
.fields(["id", "firstName", "lastName", "pictureUrl", "publicProfileUrl", "emailAddress"])
.result(function(result) {
console.log(firstName);
})
.error(function(err) {
alert(err);
});
}
function liAuth(){
//
IN.User.authorize(function(){
callback();
});
//IN.UI.Authorize().place();
}Run Code Online (Sandbox Code Playgroud)
<script type="text/javascript" src="https://platform.linkedin.com/in.js">
api_key: 54545645645646
authorize: false
onLoad: onLinkedInLoad
</script>
<div onclick="liAuth()" class="loginsocbutton loginsocbutton__in" id="oauth_linkedin">click</div>Run Code Online (Sandbox Code Playgroud)
我正在使用给出承诺的第三方库,但我需要将其包装到 ngrx 效果的 Observable 中。这个想法是在应用程序成功初始化时调度新操作。但我需要在承诺解决后发送数据。
classOne.promise().then(result =>
nested.OnemorePromise(result).then(result2 =>
//(result2) dispatch new action here (result2)
)
);
Run Code Online (Sandbox Code Playgroud)
我创建了这样的东西:
classOne.promise().then(result =>
nested.OnemorePromise(result).then(result2 =>
//(result2) dispatch new action here (result2)
)
);
Run Code Online (Sandbox Code Playgroud)
更新:
@Effect()
initializeValue$: Observable<Action> = this.actions$.pipe(
ofAction(AppInitializeAction),
map(action => {
classOne.promise().then(result =>
nested.OnemorePromise(result).then(result2 =>
this.store.dispatch(new Action(result2))
// ideally just - return new Action(result2)
)
);
})Run Code Online (Sandbox Code Playgroud)
地图不是函数。