We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
` get_redrict:function (req,res) {
console.log(req.query.code); client.getAccessToken(req.query.code, function (err, result) { console.log(req.query.code); var accessToken = result.data.access_token; var openid = result.data.openid; client.getUser(openid, function (err, user) { console.log(user) }); }); },
` 第一个console.log(req.query.code);能打印,之后旧没反应了
The text was updated successfully, but these errors were encountered:
这是实例化代码
`var client = new OAuth(wechat.appID, wechat.appSecret, function (openid, callback) { // 传入一个根据openid获取对应的全局token的方法 // 在getUser时会通过该方法来获取token db.token.findOne({where:{openid:openid}}).then(function (token) { return callback(null,token); }) }, function (openid, token, callback) { // 请将token存储到全局,跨进程、跨机器级别的全局,比如写到数据库、redis等 // 这样才能在cluster模式及多机情况下使用,以下为写入到文件的示例 // 持久化时请注意,每个openid都对应一个唯一的token! db.token.upsert({access_token:token.access_token,expires_in:token.expires_in,refresh_token:token.refresh_token,openid:token.openid,scope:token.scope,create_at:token.create_at},{where:{openid:token.openid}}).then(function (result) {
})
});`
Sorry, something went wrong.
我也遇到这个问题 你那怎么解决的啊
No branches or pull requests
`
get_redrict:function (req,res) {
`
第一个console.log(req.query.code);能打印,之后旧没反应了
The text was updated successfully, but these errors were encountered: