callzhang / EatNow

Find great food in 10 seconds
http://eatnow.cc
0 stars 0 forks source link

put user error #198

Closed xmkevin closed 8 years ago

xmkevin commented 8 years ago

The user info I put is as bellow

username = "\Ud83d\Udc9d\U2026\U5c0f\U6768\U7709";
    "usual_place" =     (
    );
    vendors =     (
                {
            expiration = "2015-11-03T00:47:33+08:00";
            "open_id" = "oSEfTwDtJtNHCodhr7XAN-xa_kiw";
            provider = "com.tecent.xin";
            "refresh_token" = "OezXcEiiBSKSxW0eoylIeBIa84VaQt4DeNjPDtzegjuGKOd9D3rOtopp7J5vgqGrGV5mR8HfvylhVak3FOlI5YwsbO0pI6JKqbyTD4-9orwrhT1UAdA0_KKtTSN2NIBicfb2f_yCUoKDTD4ARrZFyQ";
            token = "OezXcEiiBSKSxW0eoylIeBIa84VaQt4DeNjPDtzegjuGKOd9D3rOtopp7J5vgqGrhPUIn81H4Pnab3YrQETHBXVcRTBYyYhwvLb09ocCKrrRDBvkthhl4mfX_6Vg1WEj3kawIhiEm7-wo_1pht6y3g";
        }
    );

But the user I get when I login is

  username = "9E3D0378-879F-405A-87AE-AC4A39CF0A5C";
    "usual_place" =     (
    );
    vendors =     (
                {
            "_id" = 56376d624c30f0210076c2a8;
            expiration = "1970-01-01T00:00:00.000Z";
            "open_id" = 0;
            provider = "com.tecent.xin";
            "refresh_token" = 0;
            token = 0;
        }
    );

The user name and vendors are modified

xmkevin commented 8 years ago

Why the PUT api parameter is :username? What if there are duplicated user names ?

callzhang commented 8 years ago

Username shouldn't be duplicated. And username is the legal identification of a user. Using "_id" is not recommended, as it is a database is, which will change when importing to another database. I will look into the issue.

callzhang commented 8 years ago

修好了 image