API文档

免登url域名

https://activity.m.duiba.com.cn/autoLogin/autologin?

输入参数(Get请求方式传参)

参数 是否必须 参数类型 限制长度 参数说明
uid yes string 255 用户唯一性标识,对应唯一一个用户且不可变 (用not_login作为uid标记游客用户,详见 游客访问)
credits yes long 20 用户积分余额(无积分体系独立活动,积分可以传0)
appKey yes string 255 接口appKey,应用的唯一标识
timestamp yes String 20 1970-01-01开始的时间戳,毫秒为单位。
redirect no string 255 登录成功后的重定向地址(需要进行urlencode编码),可以直达积分商城内的任意页面,如果不带redirect参数,默认跳转到积分商城首页
alipay no string 255 支付宝账号(如启用支付宝账号锁定则必填) 使用场景详见【充值账号锁定】
realname no string 255 支付宝实名(如启用支付宝账号锁定则必填,URL中需进行utf-8编码)使用场景详见【充值账号锁定】
qq no string 255 QQ号(如启用Q币账号锁定则必填)使用场景详见【充值账号锁定】
phone no string 255 手机号码(如启用话费账号锁定则必填)使用场景详见【充值账号锁定】
dcustom no string 255 自定义参数,使用场景详见【dcustom参数】
transfer no string 255 自定义参数,使用场景详见【transfer参数】
signKeys no string 255 自定义参数,使用场景详见【signKeys参数】
sign yes string 255 MD5签名,详见 【签名规则】

免登录地址示例

https://activity.m.duiba.com.cn/autoLogin/autologin? uid=test001&credits=100&appKey=jlg88loSQobWDMmGrPLqtmr& sign=fbce303d7ba7ca7b0fe14d576b494769&timestamp=1418625055000& 【特别提醒】免登录生成工具链接

http://wechat.duiba.com.cn/dbtool

注意事项

1.redirect 参数在拼装免登录地址时候需要进行URLEncode编码,否则会导致请求解析报错。

2.为了确保客户端每次请求到都是最新的免登录url,客户端每次向服务器发的请求不能是固定的,以避免请求被缓存。

3.积分商城免登录url经过签名,该url地址5分钟失效,请务必在生成地址后立即使用,使用后页面会重定向进入积分商城,登录状态24小时有效。

4.开发者服务器端需要开发一个支持重定向的接口实现动态生成免登录url地址,该接口地址配置在客户端,用户通过点击该地址访问积分商城。

5.appSecrect 是积分商城签名验证的关键密钥,切勿作为参数加入免登URL,否则将导致appSecrect泄露,由此造成的损失积分商城概不负责。

代码示例

java

CreditTool tool=new CreditTool(appKey, appSecret);
Map params=new HashMap();
params.put("uid","userId001");
params.put("credits","100");
if(redirect!=null){
 // redirect是目标页面地址,如果要跳转到积分商城指定页面,redirect地址就是目标页面地址
 //此处请设置成一个外部传进来的参数,方便运营灵活配置
 params.put("redirect", redirect);
}
String url=tool.buildUrlWithSign("https://activity.m.duiba.com.cn/autoLogin/autologin?",params);
//此url即为免登录url

php

/**
 * 测试生成免登录url
 * 免登录地址涉及到的参数包含
 * $uid,$credits,$redirect,$dcustom,$transfer,$vip等参数
 */
include 'duiba-sdk.php';
$appKey = 'AppKey';//填写自己应用的appKey
$appSecret ='AppSecret';//填写自己应用的AppSecret
$uid = '111';
$credits="1000";
#$transfer = urlencode("a=1&b=2");
#dcustom = urlencode("v=1&f=2");
#$params= array("uid"=>$uid,"credits"=>$credits,"redirect"=>$redirect,"transfer"=>$transfer,"dcustom"=>$dcustom);
$params= array("uid"=>$uid,"credits"=>$credits);
$url = "https://activity.m.duiba.com.cn/autoLogin/autologin?";
$autourl = buildUrlWithSign($url,$appKey,$appSecret, $params);

results matching ""

    No results matching ""