Permalink
Browse files

change some common data

  • Loading branch information...
1 parent 5cb6690 commit 06c6f6227becf6ee1b165a2c7b6c03215a1be660 @btspoony committed Feb 15, 2013
Showing with 6 additions and 6 deletions.
  1. +2 −2 lib/qq.js
  2. +2 −2 lib/renren.js
  3. +2 −2 lib/wyx.js
View
@@ -114,7 +114,7 @@ function _formatUser( data ){
delete data.openid;
}
- data.gender = data.gender == '';
+ data.gender = data.gender == '' ? 1 : 0;
if( data.figureurl != undefined ){
data.imageUrl = data.imageUrlMiddle = data.imageUrlLarge = data.figureurl;
@@ -132,7 +132,7 @@ function _formatUser( data ){
}
if( data.is_yellow_vip != undefined ){
- data.isSpecial = !!data.is_yellow_vip;
+ data.isSpecial = Number(data.is_yellow_vip);
delete data.is_yellow_vip;
}
View
@@ -180,11 +180,11 @@ Renren.prototype.geneCommonUser = function (data) {
delete data.mainurl;
}
if(data.sex !== undefined) {
- data.gender = data.sex == 1;
+ data.gender = Number(data.sex);
delete data.sex;
}
if(data.zidou !== undefined) {
- data.isSpecial = Boolean(data.zidou == 1);
+ data.isSpecial = Number(data.zidou);
delete data.zidou;
}
if(data.vip !== undefined) {
View
@@ -150,11 +150,11 @@ WYX.prototype.geneCommonUser = function (data) {
}
if(data.gender !== undefined){
- data.gender = data.gender == 'm'
+ data.gender = data.gender == 'm' ? 1 : 0;
}
if(data.verified !== undefined) {
- data.isSpecial = Boolean(data.verified);
+ data.isSpecial = Number(data.verified);
delete data.verified;
}

0 comments on commit 06c6f62

Please sign in to comment.