开发者社区> 问答> 正文

jsapi 权限效验失败


<script type="text/javascript">
$(document).ready(function () {
        var url = window.location.href;
        console.log("url", url);
        var corpId = "ding9c2a3b0974714ae9";  // 企业的corpId
        var signature = "<%=signature%>"; //经过钉钉debug测试没错
        var nonceStr = "woxihuan123";
        var timeStamp = "<%=timestamp%>"; //1503402943
        var agentId = "4958025";

                dd.config({
                    agentId: agentId,
                    corpId: corpId,
                    timeStamp: timeStamp,
                    nonceStr: nonceStr,
                    signature: signature,
                    jsApiList: [
                        'runtime.info',
                        'biz.contact.choose',
                        'device.notification.confirm',
                        'device.notification.alert',
                        'device.notification.prompt',
                        'biz.ding.post',
                        'biz.util.openLink'] //必填,需要使用的jsapi列表
                });

                dd.ready(function () {
                        console.log('dd.ready rocks!')

                        dd.runtime.info({
                            onSuccess: function (info) {
                                console.log('runtime info: ' + JSON.stringify(info));
                                                                alert(JSON.stringify(info));
                            },
                            onFail: function (err) {
                                console.log('fail: ' + JSON.stringify(err));
                                alert(JSON.stringify(err));
                            }
                        });

                        dd.runtime.permission.requestAuthCode({
                            corpId: corpId, //企业id
                            onSuccess: function (info) {
                                console.log('authcode' + info.code);
                                alert('authcode = '+info.code);
                                Window.authcode = info.code;   //免登授权码
                            },
                            onFail: function (err) {
                                console.log('requestAuthCode fail: ' + JSON.stringify(err));
                                alert(JSON.stringify(err));
                            }
                        });
                    }
                );

dd.error(function(err) {
        alert('dd error: ' + JSON.stringify(err));
});
    });
</script>

返回dd error{ Code:52013, nonce: 相同 ,timestamp: 0 ,url:相同 ,ticket :相同,errorCode:3}

展开
收起
大侠小奎 2017-08-22 13:16:31 2182 0
1 条回答
写回答
取消 提交回答
  • Rejsapi 权限效验失败
    请问这个 错误是什么原因呀,什么地方需要修改呢

    -------------------------

    Rejsapi 权限效验失败
    已解决 时间戳,写错了
    2017-08-22 13:37:12
    赞同 展开评论 打赏
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载