开发者社区> 问答> 正文

在免登里面写入ajax第一次成功,第二次就失败


                    dd.ready(function() {
                      //发钉测试
                        
                       dd.biz.ding.post({
                         users : ['manager8227'],//用户列表,工号
                         corpId: myConfig.corpId, //企业id
                         type: 1, //钉类型 1:image  2:link
                         alertType: 2,
                         alertDate: {"format":"yyyy-MM-dd HH:mm","value":"2015-05-09 08:00"},
                         attachment: {
                             images: [''],
                         }, //附件信息
                         text: '', //消息
                         onSuccess : function() {
                         //onSuccess将在点击发送之后调用
                         },
                         onFail : function() {}
                      })
                      
                      dd.runtime.permission.requestAuthCode({
                        corpId: myConfig.corpId,
                        onSuccess: function(result) {
                            alert(JSON.stringify(result));
                            if(result!=null){
                                   $.ajax({
                                         url: common.currentPath+"/UserInfoAction.do",
                                         data:"code="+result.code,
                                         type: 'post',
                                         success: function (data, status, xhr) {
                                            var myData=eval("("+data+")");
                                             var info=myData.response2;
                                             //保存当前钉钉用户身份
                                             sessionStorage.setItem("info",info);
                                             sessionStorage.setItem("mobile",info.mobile);
                                             sessionStorage.setItem("userId",info.userid);
                                             sessionStorage.setItem("name",info.name);
                                             //login(info.name,info.mobile);
                                             login("918625","13146671859");    //老师
                                         },
                                         error: function (xhr, errorType, error) {
                                             alert("yinyien"+JSON.stringify(error));
                                             alert(errorType + ', ' + error);
                                         }
                                     });
                            }
                        },
                        
                        onFail : function(err) {
                            alert(JSON.stringify(err));
                        }


                      })

展开
收起
依然狂舞 2015-12-29 16:44:56 5457 0
3 条回答
写回答
取消 提交回答
  • Re在免登里面写入ajax第一次成功,第二次就失败
    第二次是指什么啊,第二次打开这个页面吗?
    2015-12-31 15:30:33
    赞同 展开评论 打赏
  • Re在免登里面写入ajax第一次成功,第二次就失败
    权限验证失败,3
    2015-12-31 10:48:34
    赞同 展开评论 打赏
  • Re在免登里面写入ajax第一次成功,第二次就失败
    有什么错误信息?
    2015-12-29 18:54:06
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

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