Skip to content

Commit

Permalink
User refresh name or portraitUri separately.
Browse files Browse the repository at this point in the history
Support user refresh name or portraitUri separately.
  • Loading branch information
ericyangpan authored Jul 17, 2016
1 parent 4f7f198 commit 13fad6f
Showing 1 changed file with 24 additions and 5 deletions.
29 changes: 24 additions & 5 deletions lib/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,30 @@ exports.getToken = function( userId, name, portraitUri, format, callback ) {
}

exports.refresh = function( userId, name, portraitUri, format, callback ) {
rongrequest.request( apis['user']['refresh'], {
userId : userId,
name : name,
portraitUri : portraitUri
}, format, function( err, result ) {
var params

if(name && portraitUri)
params = {
userId: userId,
name: name,
portraitUri: portraitUri
}
else if(name && !portraitUri)
params = {
userId: userId,
name: name
}
else if(!name && portraitUri)
params = {
userId: userId,
portraitUri: portraitUri
}
else
params = {
userId: userId
}

rongrequest.request( apis['user']['refresh'], params, format, function( err, result ) {
return callback( err, result );
} );
}
Expand Down

0 comments on commit 13fad6f

Please sign in to comment.