开发者社区> 问答> 正文

PC版钉钉免登失败

求助:以下代码,手机端免登正常登录,为什么PC版无法登录,好像 DingTalkPC.ready没有运行.是怎么回事?谢谢各位了.


    @{
        string ddstr = "";
        if (ViewBag.client == "dd")
        {
            <script type="text/javascript" src="http://g.alicdn.com/ilw/ding/0.8.9/scripts/dingtalk.js"></script>
            ddstr = "dd";
        }
        else if (ViewBag.client == "ddpc")
        {
            <script type="text/javascript" src="http://g.alicdn.com/dingding/dingtalk-pc-api/2.3.1/index.js"></script>      
            ddstr = "DingTalkPC";
        }
    }
    <script type="text/javascript">
        var _config = {
            agentId: '@ViewBag.appId',
            corpId: '@ViewBag.corpId',
            timeStamp: '@ViewBag.timestamp',
            nonce: '@ViewBag.nonceStr',
            signature: '@ViewBag.signature'
        };
        var ddapi =@ddstr;  
        ddapi.config({
            agentId: _config.agentId,
            corpId: _config.corpId,
            timeStamp: _config.timeStamp,
            nonceStr: _config.nonce,
            signature: _config.signature,
            jsApiList: ['runtime.permission.requestAuthCode']
        });
        ddapi.ready(function () {
             ddapi.runtime.permission.requestAuthCode({
                corpId: _config.corpId,
                onSuccess: function (result) {            
                    location.href = "/Login/DdLoginServer/?code=" + result["code"];
                },
                onFail: function (err) {        
                }
            });
        });      
    </script>

展开
收起
农村干部 2016-04-18 17:44:41 5194 0
1 条回答
写回答
取消 提交回答
  • 回 楼主(农村干部) 的帖子
    亲,是否有报错信息,截图发下啊
    2016-04-18 18:35:25
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
钉钉小程序——为工作方式插上翅膀 立即下载
钉钉客户端自动化的应用 立即下载
使命必达 —— 钉钉企业级 消息服务的机遇与挑战 立即下载