开发者社区> 问答> 正文

dd.config和dd.error不执行


从后台请求参数成功, dd.config,dd.erroe  ,dd. ready 全部不执行,  代码放在服务器,在钉钉客户端运行,依旧不运行,  


<script type="text/javascript" src="https://g.alicdn.com/dingding/open-develop/1.6.9/dingtalk.js"> </script>


sgClient.getDingdingSign(data, function(rs) {
                            if (rs && rs.state == 1) {
                                alert("请求成功");
                                dd.config({
                                    agentId: rs.data.agentId,
                                    corpId: rs.data.corpId,
                                    timeStamp: rs.data.timestamp,
                                    nonceStr: rs.data.nonceStr,
                                    signature: rs.data.signature,
                                    jsApiList: [
                                        'runtime.info',
                                        'biz.contact.choose',
                                        'device.notification.confirm',
                                        'device.notification.alert',
                                        'device.notification.prompt',
                                        'biz.ding.post',
                                        'biz.util.openLink'
                                    ] //必填,需要使用的jsapi列表
                                });
                                 dd.error(function(err) { //验证失败  
                                    alert("进入到error中");
                                    document.getElementById("userName").innerHTML = "验证出错";
                                    alert('dd error: ' + JSON.stringify(err));
                                })

                                dd.ready(function() {
                                    console.log('dd.ready rocks!')
                                    dd.runtime.info({
                                        onSuccess: function(info) {
                                        },
                                        onFail: function(err) {
                                        }
                                    });
                                    dd.runtime.permission.requestAuthCode({
                                        corpId: rs.data.corpId,
                                        onSuccess: function(result) {
                                        },
                                        onFail: function(err) {
                                        }
                                    });

展开
收起
journey_ycl 2017-09-13 15:32:18 6031 0
1 条回答
写回答
取消 提交回答
  • Redd.config和dd.error不执行
    经过两天的挣扎,终于得出结论,在钉钉上开发移动应用,测试的时候一定要上传服务器,在钉钉内部来执行,同时还要保证你连的网是可以访问钉钉的,要不然ready不会执行!
    2017-09-15 14:16:36
    赞同 展开评论 打赏
问答地址:
问答排行榜
最热
最新

相关电子书

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