user-sdk
v1.3.2
Published
User information storage system SDK for Nodejs
Downloads
5
Readme
user-sdk
Introduction
- Description : User information storage system SDK for Nodejs
- Engineer : Berwin (95)
- CreateTime : 2015-03-06
安装(installation)
$ npm install user-sdk
Usage Example
init
var user = require( 'user-sdk' );
user.create({
MD5_SUFFIX : 'MD5_SUFFIX',
APPID : 'APPID',
ENTRANCE : 'test'
});
Parameters
ENTRANCE
: 项目名称,用于查看用户在哪个平台注册的账号
APPID and MD5_SUFFIX
: 用于身份验证
此SDK目前只提供我自己使用。所以APPID和MD5_SUFFIX暂时保密~~~
signup
user.signup({
mail : '[email protected]',
password : '111'
}, function (err, res, result) {
console.log('signup:', res.statusCode, result);
});
signin
user.signin({
mail : '[email protected]',
password : '123456'
}, function (err, res, result) {
console.log('signin:', res.statusCode, result);
});
Parameters
mail
: 邮箱
password
: 密码
get User
user.get({
userID : '5540a670feecd0b03cc1054e'
}, function (err, res, result) {
console.log('get:', res.statusCode, result);
});
Change password
user.update({
userID : '5540a670feecd0b03cc1054e',
password : '123456'
}, function (err, res, result) {
console.log('update password:', res.statusCode, result);
});
activate mail
user.update({
userID : '5540a670feecd0b03cc1054e',
activate : true
}, function (err, res, result) {
console.log('activate mail:', res.statusCode, result);
});
Parameters
userID
: 用户ID
License
The MIT License (MIT)
Copyright (c) <2015> berwin [email protected]
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.