wx_widget_sdk

widget sdk

wx_widget_sdk

================

安装方法:

	npm imstall wx_widget_sdk

使用方法:

	var sdk = require('wx_widget_sdk');
	var _clientId = "5245790aad1f453aae73a2a1"
	var _clientKey = "10856caf8733f3466ebc7c9198dead0b"
	var _gourpId = "52457954ad1f453aae73a2a3"
	var _voteId = "5245795fad1f453aae73a2a4"
	var _host = "http://127.0.0.1:8080";

	var sdkIns = sdk.create({
				clientId:_clientId,
				clientKey:_clientKey,
				widgetHost:_host
			});
	var uobj = {
		name:"joymap",
		appuserid:"123456",
		mobile:"13333333333",
		regip:"127.0.0.1"
	}
	sdkIns.registUser(uobj, function(err,obj){
		//do something
	})
	sdkIns.getUserInfo(app_user_id, function(err,obj){
		//do something								
	})
	sdkIns.getVote(_gourpId, function(err,obj){
			//do something
	})
	sdkIns.createVote(app_user_id, _voteId, ipaddress, function(err,obj){
		//do something
	})
	sdkIns.getUserVoteByGroup(user_id, _gourpId, function(err,obj){
			//do something
	})
	var uobj = {
		mobile:"13333333333",
		password:"123456",
		appuserid:"123456", //可选,如果有则会去绑定
		regip:"127.0.0.1",
		agent:"mac"
	}
	sdkIns.registPlatUser(uboj, function(err,obj){
		//do something
	})		
	sdkIns.getPlatUserInfoByAppUserId(appuid, function(err,obj){
			//do something
	})
	sdkIns.platUserBind(mobile,pwd,appuid, function(err,obj){
			//do something
	})
	sdkIns.platUserLogin(mobile,pwd,appuid, function(err,obj){
			//do something
	})
	sdkIns.getPlatUserInfoByToken(mobile,pwd,appuid, function(err,obj){
			//do something
	})

测试命令:

node ./test/run.js