Javascript LinkedIn API未打开登录页面
Vue.js Node.jsJavascript LinkedIn API未打开登录页面,javascript,node.js,vue.js,linkedin,Javascript,Node.js,Vue.js,Linkedin,Vue.js Node.js async signInWithLinkedIn() { console.log("Sign In Clicked!") try { const response = await CustomerProfileService.signInLinkedIn() if(response.data.error != null){ this.error = 'Please try again.' }else{ thi
async signInWithLinkedIn() {
console.log("Sign In Clicked!")
try {
const response = await CustomerProfileService.signInLinkedIn()
if(response.data.error != null){
this.error = 'Please try again.'
}else{
this.error = 'Successful.'
}
} catch (error) {
//this.error = error.response.data.error
}
}
我正在使用
节点linkedin
包从用户那里获取一些linkedin数据。因此,当nodejs代码运行时,没有错误,但它不会将我重定向到登录页面,在那里我将批准请求。我怎样才能解决这个问题?先谢谢你 你的catch(error){}
隐藏了错误---你确定没有错误吗?没有错误,因为它运行了这一行:this.error='Successful.@CodyG.我可以在我的网络中看到LinkedIn重定向URL(按F12键),但它只是没有重定向@是否期望您使用javascript重定向它<代码>窗口位置=”http://www.example.com/";你能提供你正在看的API吗@科迪格。
var Linkedin = require('node-linkedin')('aaaa', 'bbbb')
async signInLinkedIn (req, res) {
//var scope = ['r_basicprofile', 'r_emailaddress']
// This will ask for permisssions etc and redirect to callback url.
Linkedin.auth.setCallback('http://localhost:4172/linkedInCallBack')
//Linkedin.auth.authorize(res, scope)
Linkedin.auth.authorize(res)
}