function setCopyBtn(){$(".CopyToClipboard").each(function(){var e=new ZeroClipboard.Client;e.setHandCursor(!0),e.addEventListener("load",function(e){}),e.addEventListener("mouseOver",function(e){var t=e.movie.parentNode.parentNode.parentNode.parentNode.parentNode.nextSibling.innerHTML;t=t.replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&"),e.setText(t)}),e.addEventListener("complete",function(e,t){alert("代码已经复制到你的剪贴板。")}),e.glue(this,this.parentNode)})}function computePos(){"object"==typeof toolBar&&(toolBar.setPosX(),toolBar.computePositon())}function getRecommendListUrl(){return null!==getRecommendListUrlArr?getRecommendListUrlArr:(getRecommendListUrlArr=[[],[]],$(".recommend-box div.recommend-item-box").each(function(e,t){if($(t).data("url")){var o=$(t).data("url").toLowerCase().split("://"),n=$(t).data("url").toLowerCase().split("article/details/");getRecommendListUrlArr[0].push(2==o.length?o[1]:o[0]),getRecommendListUrlArr[1].push(2==n.length?"article/details/"+n[1]:n[0])}}),getRecommendListUrlArr)}function baidudatatemp(e,t,o,n){var i="blog",a='
博客';e.linkUrl.indexOf("download.csdn.net")>-1?(i="download",a='
下载'):e.linkUrl.indexOf("edu.csdn.net")>-1&&(i="edu",a='
课程');var s=highlight.map(function(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")});10==setBaiduJsCount&&(a=""),s="("+s.join("|")+")";var c=new RegExp(s,"gi"),r=/<[^>]*>/g,l=e["abstract"].replace(r,"").replace(c,"$1"),d=e.dispTime.replace(/^(\d*)-/,""),m=e.linkUrl,p=e.title.replace(r,"").replace(c,"$1"),u=m.split("?")[0].split("/").splice(-1)[0],h='"extra":"{\\"utm_medium\\":\\"distribute.'+baiduSearchChannel+".none-task-"+i+"-2~default~baidujs_"+baiduSearchType+"~default-"+t+"-"+u+"-blog-"+articleId+baiduSearchIdentification+'\\",\\"dist_request_id\\":\\"'+distRequestId+'\\",\\"parent_index\\":\\"'+o+'\\"}",',f='
下载
');var o='
'+e.format_path+'
已加入 GitHub加速计划 每天同步更新
收藏
'+t+'
'+e.star_count+'
'+e.fork_count+"
"+l+"
\n",type:"original",status:2,read_type:"public",authorized_status:!1,check_original:!1,source:"pc_postedit",not_auto_saved:1,cover_type:1,vote_id:0,scheduled_time:0,is_new:1,tags:"笔记"}),e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}else $("#articleSearchTip").remove(),showToast({text:"选中内容为空,请重新选中",bottom:"10%",zindex:9e3,speed:500,time:1500});else window.csdn.loginBox.show()}}),$(document).on("click",".comment-quote-close",function(e){var t=$("#commentQuote");t.animate({height:0},300,function(){t.remove()})})}),window.apiOpenEditor=function(e){console.log(e,8886666),showToast({text:"请稍后再试",bottom:"10%",zindex:9e3,speed:500,time:2e3})},function(){function e(e){o.hasClass("no-login")||($("div.article_content").removeAttr("style"),0==$(".column-mask").length&&$(".hide-article-box").hide(),o.hasClass("fans_read_more")&&($("#btnAttent").hasClass("attented")||e.originalEvent&&($(".tool-attend").trigger("click"),window.csdn.report.reportClick({mod:"popu_376",spm:"1001.2101.3001.4248",extend1:"粉丝登录阅读更多"}))))}function t(t,o){var n=($(window).height(),$("div.article_content")),i=n.height();$("#btn-readmore").attr("height",o),i>2e3?(n.css({height:"2000px",overflow:"hidden"}),t.click(e)):t.parent().hide()}var o=$(".btn-readmore");o.length>0||$(".vip-mask").length>0?currentUserName?t(o,3):t(o,2):0==$(".column-mask").length&&$(".hide-article-box").addClass("hide-article-style");var n=window.location.hash,i=RegExp(/\#/);n.match(i)&&($(".btn-readmore").parent().hide(),$("div.article_content").removeAttr("style")),window.csdn=window.csdn?window.csdn:{},window.csdn.clearReadMoreBtn=e}(),$(function(){function e(e){e.list&&e.list.length&&($.each(e.list,function(e,t){var o="",n="";articleId==t.articleId&&(o="active"),t.preView&&(n='试读'),i.columnlistStr+='"}),e.total-e.page*e.size>0?(i.columnPage+=1,i.columnlistStr+='查看更多
暂无更多内容
',$(document).find(i.columnlistHeight).append(i.columnlistStr),i.columnlistStr="")}function t(e,t,o,n){$.ajax({type:"GET",url:blogUrl+e,dataType:"json",xhrFields:{withCredentials:!0},data:t,success:function(e){200==e.code&&o(e.data)},error:function(e){}})}function o(e,t){if(getCookie("UserName")){var o=blogUrl+"phoenix/web/v1/subscribe/subscribe";$.ajax({url:o,type:"post",dataType:"json",data:e,xhrFields:{withCredentials:!0},success:function(e){200===e.code&&(e.data.status&&showToast({text:e.data.msg,bottom:"10%",zindex:9003,speed:500,time:1500}),t.removeClass("articleColumnFreeBt").html("已订阅"))}})}else window.csdn.loginBox.show({spm:"1001.2101.3001.8607"})}function n(e,t,o){if($(document).find(e).length){var n=$(document).find(e).outerHeight(!0),i=$(document).find(t).outerHeight(!0),a=$(document).find(o).outerHeight(!0);$(document).find(o).css({height:n-i+a})}}var i={columnlistBox:"#columnlistBox",columnlistClose:".columnlist-close",columnlistContent:".columnlist-content-box",columnlistHeight:".columnlist-list-box",columnlistShow:$(".bt-columnlist-show"),columnlistShadow:$(".directory-boxshadow"),columnlistItem:$(".column-group"),columnlistUrl:"phoenix/web/v1/column/article-list",columnId:"",columnPage:1,columnlistStr:""};i.columnlistItem.on("click",function(e){$(this).children().length>1&&!$(e.target).is(".item-target")&&($(this).hasClass("open")?($(this).removeClass("open"),$(this).find(".dec").show()):($(this).addClass("open"),$(this).find(".dec").hide()))});var a="";studyLearnWord&&(a=''+studyLearnWord+""),i.columnlistShow.on("click",function(o){i.columnId=$(this).data("id");var s="",c="",r="",l="",d="",m="";isOwner||($(this).data("free")?s=$(this).data("subscribe")?'已订阅':'订阅专栏':($(this).data("join")?$(this).data("studyvip")?$(this).data("subscribe")?s='已订阅 8折续费 '+a+"":(s=' 会员已订阅 ',s+='
:这篇文章对你有帮助吗?作为一名程序工程师,在评论区留下你的困惑或你的见解,大家一起来交流吧!
'),t.renderData(e.list),getCookie("UserName")?(t.btnShowMore.parent("div.opt-box").remove(),t.showAll=!0,e.floorCount<=t.pageSize?t.commentPagination.addClass("d-none"):0===$("#btnMoreComment").length&&t.commentPagination.removeClass("d-none")):e.floorCount<=3?(t.btnShowMore.parent("div.opt-box").remove(),t.showAll=!0):e.floorCount<=t.pageSize?t.commentPagination.addClass("d-none"):0===$("#btnMoreComment").length&&t.commentPagination.removeClass("d-none"),null===t.commentPageObj?e.pageCount>0&&(t.commentPageObj=new Paging,t.commentPageObj.init({target:t.commentPagination,pagesize:t.pageSize,count:t.commentCount,current:1,firstTpl:"",lastTpl:"",callback:function(e,o,n){t.getPagination(e)}})):t.commentPageObj.render({count:t.commentCount}),""!==m){var n=$("div.has-comment-con ul.comment-list:first-child").find("li.comment-line-box");$(n).each(function(e,t){if(m==$(t).data("commentid")){var o=$(document).scrollTop(),i=$("#csdn-toolbar").height(),a=16;o<52&&(i=2*i);var s=$(n)[e].offsetTop-i-a;return setTimeout(function(){$("html,body").animate({scrollTop:s},200)},850),!1}})}}else t.btnShowMore.parent("div.opt-box").remove(),t.showAll=!0};this.firstLoad?this.getData(1,e):blogMoveHomeArticle&&this.btnShowMore.parent("div.opt-box").remove()},t.prototype.initTxt=function(){var e=this;$("#comment_content").length&&$("#comment_content").focus(function(){e.addId(e);var t=e.commentFontLimit-parseInt($(this).val().length);e.commentCountObj.text(t>=0?t:0),e.cancelBtnToggle(!1),e.commentLineBox.length>0&&($("#commentEditBox").siblings(".comment-list-item").find("a.btn-reply").html("回复"),e.commentLineBox.find(".comment-edit-box").remove())}),getCookie("UserName")&&($(document).click(function(t){if(!$(t.target).is("div.comment-edit-box *")&&!$(t.target).is(".right_recommend_comment_button *")&&!$(t.target).is(".reply")&&($(".comment-operate-isshow").hide(),e.txtComment.length>0)){var o=e.commentFontLimit-e.txtComment.val().length;e.commentCountObj.text(o>=0?o:0)}}),$(document).click(function(e){$(e.target).is(".comment-line-box *")||($("#commentEditBox").siblings(".comment-list-item").find("a.btn-reply").html("回复"),$("#commentEditBox").remove())})),$("input.btn-comment-defualt").click(function(){$(".tool-item-comment").trigger("click")}),$(".tool-item-comment").click(function(){setTimeout(function(){$("#pcCommentBox").show(),$("#comment_content").focus()},0)})},t.prototype.bindBtn=function(){function e(e){return"svg"===this.nodeName||getCookie("UserName")?(t.commentCount>t.pageSize&&t.commentPagination.removeClass("d-none"),$(this).parent("div.opt-box").remove(),$(this).parent().parent("div.opt-box").remove(),t.showAll=!0,t.curH=0,void(window.event?window.event.cancelBubble=!0:e.stopPropagation())):(csdn.loginBox.show(),!1)}var t=this;$(document).on("click",".comment-operate-item",function(e){var o=$(e.target).data("type");if(void 0!==o)switch(o){case"report":var n=$(e.target).parents("li.comment-line-box"),i=n.data("commentid"),a=n.data("replyname");window.csdn.loginBox.key({biz:"blog",subBiz:"other_service",cb:function(){window.csdn.feedback({type:"blog",rtype:"comment",rid:i,reportedName:a,submitOptions:{contentUrl:articleDetailUrl},callback:function(){showToast({text:"感谢您的举报,我们会尽快审核!",bottom:"10%",zindex:9e3,speed:500,time:1500})}})}});break;case"reply":var s=$(e.target)[0].innerText;if($(this).find("a.btn-reply").text("回复"),$(e.target)[0].innerText="回复"==s?"收起":"回复",t.isCommentFold){if(!getCookie("UserName"))return window.csdn.loginBox.show(),!1;$("#commentEditBox").remove();var c=t.commentFoldTextareaStr("commentEditBox","New");if(!$("#commentEditBox").length&&"回复"==s){$(e.target).parents(".comment-list-item").after(c);var r=$(e.target).parents(".comment-line-box");t.addId(t,"new"),t.comment(),t.bindTxt(),curComment={},curComment.Id=r.data("commentid"),curComment.User=r.data("replyname"),curComment.text=r.find(".name").text()+(r.find(".nick-name").length?" 回复 "+r.find(".nick-name").text():"")+r.find(".comment").text(),t.cancelBtnToggle(!0),t.replayComment(curComment),t.txtComment.trigger("focus"),t.commentCode()}}else"回复"==s?"":$("#commentEditBox").remove();break;case"delete":var l=$(e.target).data("nickname"),d=$(e.target).parents("li.comment-line-box"),i=d.data("commentid");showConfirm({tit:"删除评论",text:'确认将 "'+l+'" 的评论删除吗?',isBlack:"Black"==skinStatus,rightText:"确定",zindex:9e3,success:function(){t.commentIsDelete(i)},cancel:function(){}});break;case"istop":var l=$(e.target).data("nickname"),m="false"!=$(e.target).attr("data-status"),p=$(e.target).parents("li.comment-line-box"),i=p.data("commentid");showConfirm({tit:m?"取消置顶":"置顶评论",text:m?'确认将 "'+l+'" 的评论取消置顶吗?':'确认将 "'+l+'" 的评论置顶吗?',isBlack:"Black"==skinStatus,rightText:"确定",zindex:9e3,success:function(){t.commentIsTop(i,m)},cancel:function(){}});break;case"blacklist":var m="false"!=$(e.target).attr("data-status"),u=$(e.target).data("username"),l=$(e.target).data("nickname");showConfirm({tit:m?"取消屏蔽":"屏蔽用户",text:isCurrentUserVip?m?'确认将 "'+l+'" 取消屏蔽吗?取消后对方即可在您的内容下进行评论':'确认将 "'+l+'" 屏蔽吗?屏蔽后对方将无法在您的内容下进行评论':"屏蔽用户为会员权益,您可加入会员行使该权益",isBlack:"Black"==skinStatus,rightText:isCurrentUserVip?"确定":"开通会员",zindex:9e3,success:function(){var e="";isCurrentUserVip?(e=m?"1001.2101.3001.6915":"1001.2101.3001.6913",t.commentIsBlack(username,u,m)):(window.open("https://www.csdn.net/vip?utm_source=commentblocking","_blank"),e="1001.2101.3001.6917"),window.csdn.report&&"function"==typeof window.csdn.report.reportClick&&window.csdn.report.reportClick({spm:e})},cancel:function(){}})}}),this.btnShowMore.click(e),this.btnShowMore.find("svg").click(e)},t.prototype.bindTxt=function(){var e=this;this.txtComment.blur(function(){}),this.txtComment.keyup(function(){var t=e.commentCountObj,o=e.commentFontLimit-$(this).val().length;o<0?t.text(0):t.text(o),$(this).val().length||$(this).data("replayUser")?e.cancelBtnToggle(!0):e.cancelBtnToggle(!1)})},t.prototype.renderData=function(e){var t=this,o=t.commentFoldTextareaStr("commentEditBox","New");t.buildListDom(e,!1,this,!0),$(".comment-list li.comment-line-box").on("click",function(e){if($(e.target).data("flag")&&(t.commentLineBox&&t.commentLineBox[0]!=$(this)[0]&&t.commentLineBox.find(".comment-edit-box").remove(),0==$(this).find(".comment-edit-box").length)){if(getCookie("UserName")){getCookie("UserName")&&($(this).append(o),$("#closeNew").on("click",function(e){$(this).parents(".comment-edit-box").remove()}),t.addId(t,"new"),t.comment(),t.bindTxt(),curComment={},curComment.Id=$(this).data("commentid"),curComment.User=$(this).data("replyname"),curComment.text=$(this).find(".name").text()+($(this).find(".nick-name").length?" 回复 "+$(this).find(".nick-name").text():"")+$(this).find(".comment").text(),t.cancelBtnToggle(!0),t.replayComment(curComment),t.txtComment.trigger("focus"),t.commentCode());var n=$(document).scrollTop(),i=$("#csdn-toolbar").height();n<52&&(i=2*i)}else csdn.loginBox.show();t.commentLineBox=$(this)}}),n()},t.prototype.commentFoldTextareaStr=function(e,t){if($("#isShowCommentAuth").length&&1==$("#isShowCommentAuth").data("type"))var o=' | 博主筛选后可见';else var o="";var n='"+quotecontent+""+content):(content=this.replaceNewUBB(h[0]),content=this.getCodeInfo(content));var f,v=null!==p.redEnvelopeInfo,w=v?JSON.parse(p.redEnvelopeInfo):null;v&&(f=JSON.stringify({spm:"3001.9224",extend1:{orderNo:p.orderNo}}),w.money=parseFloat(parseInt(w.money)/100).toFixed(2)),u='",o.commentBoxDefault.html($(u)),o.initHotComment=!1}o.curFloor--}}return!e.length&&o.commentUnFold.total<=0&&o.commentBoxDefault.html(""),t?a:void g.getRedPacketVerifyBatch()},t.prototype.addId=function(e,t){"new"==t?(e.commentForm=$("#commentformNew"),e.txtComment=$("#comment_contentNew"),e.commentCountObj=e.commentForm.find("em"),e.commtCode=$("#commentCodeNew"),e.commentTxt=$("#comment_replyIdNew"),e.articleId=$("#article_idNew")):(e.commentForm=$("#commentform"),e.txtComment=$("#comment_content"),e.commentCountObj=e.commentForm.find("em"),e.commtCode=$("#commentCode"),e.commentTxt=$("#comment_replyId"),e.articleId=$("#article_id"))},t.prototype.bindBtnFoldMore=function(){var e=this;$(document).on("click","#lookFlodComment",function(){e.isCommentFold=!0,e.commentFold.pageIndex=1,e.getFoldList(e.commentFold),$("#pcFlodCommentSideBox").show(),$("#pcCommentSideBox").hide(),$("#pcCommentSideBox .comment-list-box").html("")}),$(document).on("click","#lookUnFlodComment",function(){e.isCommentFold=!1,e.commentUnFold.pageIndex=1,e.getPagination(e.commentUnFold.pageIndex),$("#pcFlodCommentSideBox").hide(),$("#pcCommentSideBox").show(),$("#pcFlodCommentSideBox .comment-fold-content").html("")}),t.prototype.getFoldList=function(t){$.ajax({url:blogUrl+"phoenix/web/v1/comment/list/"+articleId+"?page="+e.commentFold.pageIndex+"&size="+e.commentFold.pageSize+"&fold="+e.commentFold.fold,type:"post",xhrFields:{withCredentials:!0},success:function(t){if(200===t.code){result=t.data;result.foldCount;if($(".tool-item-comment .count").html(result.count),$(".comment-side-tit-count .count").html(result.count),$(".has-comment-tit .count").html(result.count),$(".has-comment-bt-left .count").html(result.count),$(".look-flod-comment .count").html(result.foldCount),$(".comment-fold-tit .count").html(result.foldCount),result.foldCount>0?e.lookFlodComment.show():e.lookFlodComment.hide(),result.count>0?($("#pcCommentBox").removeClass("comment-box-nostyle"),$("#pcCommentBox .has-comment").css({display:"block"}),$("#pcCommentBox .unhas-comment").css({display:"none"})):getCookie("UserName")?($("#pcCommentBox").addClass("comment-box-nostyle"),$("#pcCommentBox .has-comment").css({display:"none"}),$("#pcCommentBox .unhas-comment").css({display:"none"})):($("#pcCommentBox").removeClass("comment-box-nostyle"),$("#pcCommentBox .has-comment").css({display:"none"}),$("#pcCommentBox .unhas-comment").css({display:"flex"})),result.list.length){var o=e.buildListDom(result.list,!0,e,!1),n=document.createElement("div");n.classList.add("comment-fold-con","comment-list-box","comment-operate-item"),n.innerHTML=o,$("#pcFlodCommentSideBox .comment-fold-content").append(n),e.commentFold.pageIndex+=1,e.commentFold.pageCount=result.pageCount,e.commentFold.pageIndex>e.commentFold.pageCount?e.lookBadComment.hide():e.lookBadComment.show()}}}})}};var d="";t.prototype.buildHtml=function(e,t,n,i,a){var s="",c="",r="",l="",m=!1,p="",u="";if(e.content=this.replaceUrl(e.content),n){d=i,p=this.getQuote(e.content),e.content=this.replaceQuote(e.content);var h=this.getQuoteInfo(e.content);h.length>1?(r=h[1],l=this.getCodeInfo(h[2]),l=this.replaceNewUBB(l),s=this.getCodeInfo(h[3]),s=this.replaceNewUBB(s),s='引用“'+r+"”的评论:
"+l+""+s):(s=this.replaceNewUBB(h[0]),s=this.getCodeInfo(s)),username===getCookie("UserName")&&(m=!0)}else{var h=this.getReplyInfo(e.content);c=h[1];var f=h.length>2?this.getQuoteInfo(h[2]):this.getQuoteInfo(h[0]);f.length>1?(r=f[1],l=this.getCodeInfo(f[2]),l=this.replaceNewUBB(l),s=this.getCodeInfo(f[3]),s=this.replaceNewUBB(s),s='引用“'+r+"”的评论:
"+l+""+s):(s=this.replaceNewUBB(f[0]),s=this.getCodeInfo(s))}if(o(e),n&&p&&""!=p&&(u='

([\s\S]*?)\<\/pre\>/gi,o=[];if(e.replace(t,function(e){o.push(e)}),o.length)for(var n=e.replace(t,function(e){return"[csdnCommentPreCode]"}),i=n.replace(/\n/g,""),a=0;a");return i},t.prototype.getReplyInfo=function(e){var t=e.split(/\[reply]([\s\S]*?)\[\/reply\][\r\n]{0,1}/gi);return t},t.prototype.getQuoteInfo=function(e){var t=e.split(/\[quote=([\w#\.]+)\]([\s\S]*?)\[\/quote\][\r\n]{0,2}/gi);return t},t.prototype.getCodeInfo=function(e){var t=e.replace(/\[code=([\w#\.]+)\]([\s\S]*?)\[\/code\]/gi,function(e,t,o){return""==$.trim(o)?"":''+s(o.trim())+"
"});return t},t.prototype.replaceNewUBB=function(e){return e=e.replace(/\[face\]([^\]]+):([^\]]+)\[\/face\]/gi,'
')},t.prototype.replaceUrl=function(e){var t=/(https?|http|ftp|file):\/\/[-A-Za-z0-9+&@#\/%?=~_|!:,.;]+[-A-Za-z0-9+&@#\/%=~_|]/g,o=/\[code=([\w#\.]+)\]([\s\S]*?)\[\/code\]/gi,n=[];if(e.replace(o,function(e){n.push(e)}),n.length)for(var i=e.replace(o,function(e){return"[csdnCommentCode]"}),a=i.replace(t,function(e){return'
网页链接'}),s=0;s
网页链接'});return a},t.prototype.replaceQuote=function(e){return e=e.replace(/\[quote\]([\s\S]*?)\[\/quote\]/gi,"")},t.prototype.getQuote=function(e){var t="";return e.replace(/\[quote\]([\s\S]*?)\[\/quote\]/gi,function(e){t=e}),t=t.replace("[quote]","").replace("[/quote]","")},t.prototype.replayComment=function(e){var t=e.Id,o=e.User;this.txtComment.attr("placeholder","回复:"+e.text).data("replayUser",o),this.commentTxt.val(t)},t.prototype.commentCode=function(){var e=this;e.commtCode.find("a").click(function(t){var o="[code="+$(this).data("code")+"]\n\n[/code]",n=e.txtComment.val();(o+n).length<=e.commentFontLimit?(e.txtComment.val(n+o),"comment_content"==e.txtComment[0].id&&$("#comment-content").val(n+o),e.commtCode.parents(".comment-code-box").fadeOut()):showToast({text:"您输入的字数已经超过限定了",bottom:"10%",zindex:9e3,speed:500,time:1500});var i=t||window.event;i.stopPropagation?i.stopPropagation():i.cancelBubble=!0})},t.prototype.comment=function(){function e(e){if(!getCookie("UserName"))return t.setStorage();window.localStorage.removeItem("AM_comment_data");var o=$(e).find(":submit"),n={commentId:t.commentTxt.val(),content:t.txtComment.val(),articleId:articleId};if("block"===g.formRewardBox.css("display")&&Object.assign(n,g.rewardInfo),n.replyId&&$.trim(n.content)&&(n.content="[reply]"+t.txtComment.data("replayUser")+"[/reply]"+n.content),$(e).find("#comment_content").length&&$("#commentQuote").length&&""!==$("#commentQuote").text()&&(n.content="[quote]"+$("#commentQuote").text().substr(0,50)+"[/quote]"+n.content),""===$.trim(n.content)||""===t.txtComment.val())showToast({text:"请填写评论内容",bottom:"10%",zindex:9e3,speed:500,time:1500});else{var i=blogUrl+"phoenix/web/v1/comment/submit";o.prop("disabled",!0).val("提交中"),$.ajax({url:i,type:"post",dataType:"json",data:n,xhrFields:{withCredentials:!0},beforeSend:function(){},success:function(e){if(200===e.code){if(t.isCommentFold)t.commentFold.pageIndex=1,$("#pcFlodCommentSideBox .comment-fold-content").html(""),t.getFoldList(t.commentFold);else{t.commentForm.trigger("reset"),t.commentTxt.val(""),t.txtComment.data("replayUser","").attr("placeholder","想对作者说点什么"),t.cancelBtnToggle(!1),m=e.data,t.init(),t.removeStorage();var o=$("#commentQuote");o.length&&o.animate({height:0},300,function(){o.remove()}),t.commentUnFold.pageIndex=1,$("#pcCommentSideBox .comment-list-box").html("")}"block"===g.formRewardBox.css("display")&&g.formRewardBox.find(".btn-remove-reward").trigger("click"),showToast({text:"评论成功,审核后显示",bottom:"10%",zindex:9e3,speed:500,time:2e3})}else showToast({text:e.message,bottom:"10%",zindex:9e3,speed:500,time:2e3})},complete:function(){o.prop("disabled",!1).val("评论")}})}return!1}var t=this;t.commentForm.submit(function(t){t.preventDefault();var o=this;try{window.csdn.loginBox.key({biz:"blog",subBiz:"other_service",cb:function(){e(o)}})}catch(n){e(o)}})},t.prototype.insertRightCommnetPrompt=function(){if(window.localStorage.getItem("AM_comment_Prompt_show"))return!1;window.localStorage.setItem("AM_comment_Prompt_show",!0);var e=$(".right_recommend_comment"),t=$(".right_recommend_comment_Prompt");t.length>0?t.fadeIn(300):e.prepend('新的评论在这里'),setTimeout(function(){$(".right_recommend_comment_Prompt").fadeOut(500)},4e3)},t.prototype.setStorage=function(){return window.localStorage.setItem("AM_comment_data",this.txtComment.val()),window.localStorage.setItem("AM_comment_replyId",this.commentTxt.val()),window.localStorage.setItem("AM_comment_id",articleId),!!getCookie("UserName")||(window.csdn.loginBox.show(),!1)},t.prototype.removeStorage=function(){window.localStorage.removeItem("AM_comment_data"),window.localStorage.removeItem("AM_comment_replyId"),window.localStorage.removeItem("AM_comment_id")},t.prototype.bindLikedClick=a,t.prototype.bindRedRewardClick=i,t.prototype.cancelBtnToggle=function(e){e?this.cancelBtn.removeClass("d-none"):this.cancelBtn.addClass("d-none")},t.prototype.cancelBtnBindEvent=function(){var e=this;this.cancelBtn.on("click",function(){e.txtComment.attr("placeholder","想对作者说点什么").data("replayUser","").val(""),e.commentTxt.val(""),e.cancelBtnToggle(!1)})},t.prototype.commentIsBlack=function(e,t,o){var n=this,i="https://mp-action.csdn.net/interact/wrapper/pc/black/"+(o?"cancel":"save"),a=o?{username:e,usernameList:[t],bizNo:"blog"}:{username:e,blackUsername:t,bizNo:"blog"};$.ajax({url:i,type:"post",data:JSON.stringify(a),contentType:"application/json",dataType:"json",xhrFields:{withCredentials:!0},success:function(e){200===e.code?(setTimeout(function(){n.isCommentFold?(n.commentFold.pageIndex=1,$("#pcFlodCommentSideBox .comment-fold-content").html(""),n.getFoldList(n.commentFold)):(n.commentUnFold.pageIndex=1,$("#pcCommentSideBox .comment-list-box").html(""),n.getPagination(n.commentUnFold.pageIndex))},100),showToast({text:o?"取消屏蔽成功!":"屏蔽用户成功!",bottom:"10%",zindex:9e3,speed:500,time:1500})):showToast({text:o?"取消屏蔽失败,请刷新页面重新操作!":"屏蔽用户失败,请刷新页面重新操作!",bottom:"10%",zindex:9e3,speed:500,time:1500})}})},t.prototype.commentIsTop=function(e,t){var o=this,n=blogUrl+"phoenix/web/v1/comment/top",i={commentId:e,articleId:articleId,action:t?0:1};$.ajax({url:n,type:"post",dataType:"json",data:i,xhrFields:{withCredentials:!0},success:function(e){200===e.code?(setTimeout(function(){o.isCommentFold?(o.commentFold.pageIndex=1,$("#pcFlodCommentSideBox .comment-fold-content").html(""),o.getFoldList(o.commentFold)):(o.commentUnFold.pageIndex=1,$("#pcCommentSideBox .comment-list-box").html(""),o.getPagination(o.commentUnFold.pageIndex))},100),showToast({text:t?"取消置顶成功!":"置顶评论成功!",bottom:"10%",zindex:9e3,speed:500,time:1500})):showToast({text:t?"取消置顶失败,请重新操作!":"置顶评论失败,请重新操作!",bottom:"10%",zindex:9e3,speed:500,time:1500})}})},t.prototype.commentIsDelete=function(e){var t=this,o=$("#article_id").val(),n=blogUrl+"phoenix/web/v1/comment/delete",i={commentId:e,articleId:o};$.ajax({url:n,type:"post",dataType:"json",data:i,xhrFields:{withCredentials:!0},success:function(e){200===e.code?(setTimeout(function(){t.isCommentFold?(t.commentFold.pageIndex=1,$("#pcFlodCommentSideBox .comment-fold-content").html(""),t.getFoldList(t.commentFold)):(t.commentUnFold.pageIndex=1,$("#pcCommentSideBox .comment-list-box").html(""),t.getPagination(t.commentUnFold.pageIndex))},100),showToast({text:"删除成功!",bottom:"10%",zindex:9e3,speed:500,time:1500})):showToast({text:"删除失败,请重新操作!",bottom:"10%",zindex:9e3,speed:500,time:1500})}})},$(document).on("keydown",".comment-content",function(e){var t=e||event;(t.ctrlKey&&13==t.which||13==t.which&&t.metaKey)&&("comment_content"==$(this).attr("id")?$("#commentform .btn-comment").trigger("click"):$("#commentformNew .btn-comment").trigger("click"))}),$(document).on("click",".second-look-more",function(e){$(this).hide(),$(this).siblings(".comment-line-box-hide").show()}),$(document).on("click",".comment-operate-item",function(e){if(getCookie("UserName")){if($(".comment-operate-isshow").fadeOut(),$(this).hasClass("comment-emoticon")){""==$(".comment-emoticon-img-box").html()&&$(".comment-emoticon-img-box").html(c()),$(this).find(".comment-emoticonNew").length&&$(this).find(".comment-operate-isshow").html($("#commentform .comment-emoticon-box").html());var t=$(this).find(".comment-emoticon-box");"block"===t.css("display")?t.fadeOut():($("#comment_content").one("focus",function(){t.fadeOut()}),t.fadeIn())}else if($(this).hasClass("comment-code")){var o=$(this).find(".comment-code-box");"block"===o.css("display")?o.fadeOut():($("#comment_content").one("focus",function(){o.fadeOut()}),o.fadeIn()),!$(this).hasClass("comment-codeNew")}else $(this).hasClass("comment-reward")&&g.showRewardForm();var n=e||window.event;n.stopPropagation?n.stopPropagation():n.cancelBubble=!0}else csdn.loginBox.show()}),$(document).on("click",".emoticon-monkey-img",function(e){var t=$(this).data("emoticon");if($(this).parents(".comment-emoticon-box").is(".comment-emoticonNew")){var o=$("#comment_contentNew").val()+t;o.length<=1e3?textareaPointLocation.insertAtCaret($("#comment_contentNew")[0],t):showToast({text:"您输入的字数已经超过限定了",bottom:"10%",zindex:9e3,speed:500,time:1500})}else{var o=$("#comment_content").val()+t;o.length<=1e3?textareaPointLocation.insertAtCaret($("#comment_content")[0],t):showToast({text:"您输入的字数已经超过限定了",bottom:"10%",zindex:9e3,speed:500,time:1500})}$(this).parents(".comment-emoticon-box").fadeOut();var n=e||window.event;n.stopPropagation?n.stopPropagation():n.cancelBubble=!0}),$(document).on("mouseenter",".comment-like",function(){$(this).hasClass("liked")?($(this).find(".clickedImg").css("display","none"),$(this).find(".comment-like-img-hover").css("display","block")):($(this).find(".unclickImg").css("display","none"),$(this).find(".comment-like-img-hover").css("display","block"))}),$(document).on("mouseleave",".comment-like",function(){$(this).hasClass("liked")?($(this).find(".clickedImg").css("display","block"),$(this).find(".comment-like-img-hover").css("display","none")):($(this).find(".unclickImg").css("display","block"),$(this).find(".comment-like-img-hover").css("display","none"))}),$(document).on("click",".unlogin-comment-box-new .unlogin-comment-bt",function(){window.csdn.report&&"function"==typeof window.csdn.report.reportClick&&window.csdn.report.reportClick({spm:"1001.2101.3001.6916"}),getCookie("UserName")||window.csdn.loginBox.show({spm:"1001.2101.3001.8611"})});var m=r("#comments_");if(m&&!getCookie("UserName")){$("#pcCommentBox").show();var p=$(document).scrollTop(),u=$("#csdn-toolbar").height(),h=2*$("#pcCommentBox").height();p<52&&(u=2*u);var f=$("#pcCommentBox").offset().top-u-h;return setTimeout(function(){$("html,body").animate({scrollTop:f},200)},850),!1}var g=new e;window.csdn.comments?window.csdn.comments:{},window.csdn.Comments=t,window.csdn.comments=new window.csdn.Comments}),$(function(){if(1===articleType){var e=$("main .blog-content-box")[0],t=document.querySelector(".creativecommons span a");t=t?t.innerText:"CC 4.0 BY-SA";var o="\r\n————————————————\r\n版权声明:本文为CSDN博主「"+nickName+"」的原创文章,遵循"+t+"版权协议,转载请附上原文出处链接及本声明。\r\n原文链接:"+curentUrl;csdn.copyright.init(e,o)}}),$(function(){function e(e,o){if(!(o.length<2)){var n="";n+="";for(var i=0,a=0,s=0,c=0,r=0,l=0;li?(n+='',a++):d0&&(n+="
",a--),1==d)for(;a>0;)n+="
",a--;i=d;var m=o.eq(l).text();if(m=/^[\s]+$/.test(m)?m:m.replace(/^[\s]+/g,""),m=t(m),m.length>0)switch(d){case 1:++s,c=0,r=0;var p="";1===s&&(p="active"),n+="'+m+" ";break;case 2:++c,r=0,n+=''+m+" ";break;case 3:++r,n+=''+m+" "}}for(;a>0;)n+="",a--;return n}}function t(e){return e.replace(/[<>&"]/g,function(e){return{"<":"<",">":">","&":"&",'"':"""}[e]})}function o(e){function t(e){return $(e).each(function(e,n){n.children&&t(n.children),++o}),o}var o=0;return t(e)}function n(e,t,o){var n=$("div.groupfile"),i=n.find("div.toc-box"),a=n.find("div.opt-box");if(t<=2&&$("#liTocBox").remove(),t>2&&"0"==d&&$("#liTocBox").css("display","block"),t<=2&&"1"==d?($(".groupfile").remove(),$("#rightAsideConcision").remove()):isShowConcision?(isCookieConcision&&$(".recommend-right1").addClass("show-directory"),isHasDirectoryModel=!0):$("#rightAsideConcision").remove(),t<=2&&($("#blog_artical_directory").hide(),$(".left_menu .menu_con").hide()),!$(".first_li")[0]){i.html(o(e,m)),s(t,a,i);var c=!1;$("#liTocBox").hover(function(){$("#liTocBox .toc-container").finish().fadeIn(500),$(this).find("button.btn-toc").addClass("active"),c=!1},function(e){c=!0;var t=$(this);setTimeout(function(){c&&($("#liTocBox .toc-container").finish().fadeOut(500),t.find("button.btn-toc").removeClass("active"))},300)})}}function i(){var e=document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop;e+=10;for(var t=0;t=180?($("#recommend-right").css({position:"fixed",top:e}),$("#recommend-right-concision").css({position:"fixed",top:e})):($("#recommend-right").removeAttr("style"),$("#recommend-right-concision").removeAttr("style")),0==$(document).scrollTop()&&($("#recommend-right").removeAttr("style"),$("#recommend-right-concision").removeAttr("style"))}function s(e,t,o){if(e>9){var n=25*$("div.toc-box").find("li:not(.sub-box)").length,i=225,a=n-i,s=0;t.find("button.btn-opt").click(function(){$(this).hasClass("nomore")||($(this).hasClass("prev")?(s-=25,o.scrollTop(s),s<=0&&$(this).addClass("nomore")):(s+=25,s>=25*(e-17)&&(s=25*(e-17)),o.scrollTop(s),s>=a&&$(this).addClass("nomore")),$(this).siblings().removeClass("nomore"))})}else t.remove()}function c(){function e(t){$(".openvippay")[0]||window.csdn.clearReadMoreBtn(),o.off("click",e)}function t(){var e=window.location.href,t=document.title;setTimeout(function(){history.pushState(null,t,e)},0)}var o=$(".toc-container .toc-box ol li a");return 0!==o.length&&(o.click(e),void o.click(t))}function r(e){var t="";return $(e).each(function(e,o){t+=l(o,e)}),t+"
"}function l(e,t){return e.children.length?""+e.title+' '+r(e.children)+" ":""+e.title+" "}for(var d=1,m=$("#article_content").find("h1,h2,h3"),p=0;p'+m.eq(p).html());$(".vip_article")[0]?($.ajax({type:"GET",url:blogUrl+"/phoenix/web/v1/get-article-catalog?articleId="+articleId,dataType:"json",xhrFields:{withCredentials:!0},success:function(e){200==e.code&&(n(e.data,o(e.data),r),c(),$("#groupfile .toc-box ol li a").each(function(e,t){t.href="#t"+e}),$("#directory .toc-box ol li a").each(function(e,t){t.href="#t"+e}),""===String($(".groupfile .toc-box").text()).replace(/(^\s*)|(\s*$)/g,"")?($("#asidedirectory").remove(),$("#groupfile").remove(),$("#rightAsideConcision").remove(),isHasDirectoryModel=!1):$("#groupfile").show())}}),$("#downloadEduApp").click(function(){getCookie("UserName")?window.open("https://vip.csdn.net/studyvip?utm_source=zhuanlan"):window.csdn.loginBox.show()})):(n("",m.length,e),c(),""===String($(".groupfile .toc-box").text()).replace(/(^\s*)|(\s*$)/g,"")?($("#asidedirectory").remove(),$("#groupfile").remove(),$("#rightAsideConcision").remove(),isHasDirectoryModel=!1):$("#groupfile").show()),$(document).on("toolbarHeightChange",function(e){var t=$("#csdn-toolbar").height()+8;$("#recommend-right").css("position")&&$("#recommend-right").css({top:t})});var u=$("#content_views").find("h1,h2,h3"),h=[],f=$("#content_views").offset().top,g=$("#content_views").height(),v=$("#csdn-toolbar").height();$(u).each(function(e,t){h.push($(t)[0].offsetTop+f-2*v)}),h.push(g+f),$(window).resize(function(){h=[],f=$("#content_views").offset().top,g=$("#content_views").height(),v=$("#csdn-toolbar").height(),$(u).each(function(e,t){h.push($(t)[0].offsetTop+f-2*v)}),h.push(g+f)}),$(window).scroll(function(){$(".groupfile .toc-box li").removeClass("active"),i()}),i(),$(document).on("click",".groupfile .toc-box li a",function(e){$(".groupfile .toc-box li").removeClass("active"),$(this).parent().addClass("active")}),$(window).resize(function(){});var w=document.body.clientHeight||document.documentElement.clientHeight;if($("#groupfile").css("max-height",w/2+"px"),$(".groupfile-div").css("max-height",w/2+"px"),$(".groupfile-div1").css("max-height",w-48+"px"),$(document).scroll(function(){a()}),a(),$(document).on("click",".csdn-side-toolbar .option-box",function(e){isShowConcision&&setTimeout(function(){a()},100)}),$(".hide-article-box").length&&"none"!==$(".hide-article-box").css("display")){for(var b=$(".hide-article-box").offset().top,x=0,y=0;yx){var t=$("#getVipUrl").attr("href");t.indexOf("vip")>-1?window.open(t+"?utm_source=brv&sale_source=BgsN7mSaYF"):window.open(t)}}),$(".btn-readmore")[0]&&C.each(function(e,t){$(".groupfile .toc-box ol").find('a[href="#'+$(C[e]).find("a")[0].name+'"]').click(function(){$(".btn-readmore").trigger("click"),$(".btn-readmore").hasClass("no-login")?window.open("https://passport.csdn.net/account/login"):$("#btnAttent").trigger("click")})})}$(document).ready(function(){var e=$(".htmledit_views #main-toc").prevAll("h1,h2,h3"),t=e.length,o=$('.htmledit_views p[id*="-toc"]').slice(1).filter(function(e,t){return $(t).find("a").length||$(t).css({margin:"0"}),$(t).find("a").length});o.each(function(e,o){$(o).attr("id","");var n=$(o).css("margin-left").replace("px","")/40,i=0==n?0:48*n;$(o).css({"padding-left":"24px",margin:"0","margin-left":i+"px","margin-bottom":"2px"}),t>0?($(o).find("a").attr("href","#t"+t),t++):$(o).find("a").attr("href","#t"+e)});var n=$(".markdown_views .toc a");n.length&&n.each(function(e,t){var o=$(t).attr("href");o&&$(t).attr("href",o.replace(/%/g,"_"))});var i=$(".markdown_views").find("h1 a,h2 a,h3 a");i.length&&i.each(function(e,t){var o=$(t).attr("id");o&&$(t).attr("id",o.replace(/%/g,"_"))}),$(document).on("click","#content_views a[href*=#],div.toc-box a[href*=#],li.tool-item-comment a[href*=#]",function(){var e=$("#csdn-toolbar").height(),t=$(document).scrollTop();if(t<52&&(e=2*e),location.pathname.replace(/^\//,"")==this.pathname.replace(/^\//,"")&&location.hostname==this.hostname){var o=$(this.hash);if(o=o.length&&o||$("[name="+this.hash.slice(1)+"]"),o.length){var n=o.offset().top;return $("html,body").animate({scrollTop:n-e},500),!1}}}),setTimeout(function(){if(window.location.href.indexOf("#comments")>-1){var e=$("#csdn-toolbar").height();$("html,body").animate({scrollTop:$("#commentBox").offset().top-e-48},500)}},1e3)})}),$(function(){var e=$('#article_content a[href^="#"]');e.each(function(e){$(this).attr("target","_self")})}),function(){function e(e){var t="";i&&(t="active");var o='';n.innerHTML=o}function t(){$.ajax({url:"https://devpress-api.csdn.net/api/internal/blog/nsInfo/blog/"+articleId,type:"GET",xhrFields:{withCredentials:!0},success:function(t){200==t.code&&t.data?e(t.data):n.remove()}})}function o(e,t){$.ajax({type:"POST",url:"https://devpress-api.csdn.net/v1/user/follow",contentType:"application/json; charset=utf-8",data:JSON.stringify({followTarget:e,type:1}),xhrFields:{withCredentials:!0},success:function(e){window.open(t)},error:function(e){window.open(t)}})}var n=document.getElementById("blogHuaweiyunAdvert"),i=document.getElementById("blogColumnPayAdvert");n&&(t(),$(document).on("click","#blogHuaweiyunAdvert .column-group",function(){if(getCookie("UserName")){var e=$(this).data("id"),t=$(this).data("url");o(e,t)}else window.csdn.loginBox.show()}))}(),$(".comment-box textarea.comment-content").on("select",function(){textareaPointLocation.setCaret(this)}).on("click",function(){textareaPointLocation.setCaret(this)}).on("keyup",function(){textareaPointLocation.setCaret(this)});var textareaPointLocation={setCaret:function(e){e.createTextRange&&(e.caretPos=document.selection.createRange().duplicate())},insertAtCaret:function(e,t){if(document.all)if(e.createTextRange&&e.caretPos){var o=e.caretPos;o.text=" "==o.text.charAt(o.text.length-1)?t+" ":t}else e.value=t;else if(e.setSelectionRange){var n=e.selectionStart,i=e.selectionEnd,a=e.value.substring(0,n),s=e.value.substring(i);
e.value=a+t+s}else showToast({text:"This version of Mozilla based browser does not support setSelectionRange",bottom:"10%",zindex:9e3,speed:500,time:1500})}};$(function(){var e=$("#asideNewNps"),t=$("#asideNewNps .newnps-item"),o=$("#asideNewNps .newnps-form-box");getCookie("blog_details_nps")?e.remove():(e.fadeIn(),t.on("click",function(){$(this).siblings().removeClass("active"),$(this).siblings().find("img.default").show(),$(this).siblings().find("img.active").hide(),$(this).addClass("active"),$(this).find("img.default").hide(),$(this).find("img.active").show(),o.slideDown()}),o.on("click",".newnps-btn",function(t){if(getCookie("UserName")){o.removeClass("active"),showToast({text:"感谢您的意见,我们尽快改进",bottom:"10%",zindex:9002,speed:500,time:1500});var n={spm:"1001.2101.3001.6242",extend1:"博客详情页满意度调查",extra:JSON.stringify({radio:e.find(".newnps-item.active").data("type"),input:o.find(".newnps-input").val()})};setCookieBaseHour("blog_details_nps",(new Date).getTime(),720),window.csdn&&window.csdn.report&&window.csdn.report.reportClick(n),e.slideUp(600,function(){e.remove()})}else window.csdn.loginBox.show()}),o.on("focus",".newnps-input",function(){o.addClass("active")}))}),$(function(){function e(){function e(){$("#publicPrompt").remove(),$(document).off("click",".publicPrompt-close",e),$(document).off("click",".publicPrompt-mask",e)}var t={success:''};this.data={},this.data.status="success",this.data.titleStr="收藏成功",this.data.textStr='已收藏至 个人中心',this.data.imgUrl="",this.init=function(e){return $.extend(this.data,e),this.addStyle(),this.bindDom(),this},this.show=function(e){$.extend(this.data,e),this.insetStructure(this.data)},this.bindDom=function(){$(document).on("click",".publicPrompt-close",e),$(document).on("click",".publicPrompt-mask",e)},this.insetStructure=function(e){var o=''+t[e.status]+e.titleStr+'
'+e.textStr+'
';$("body").append(o)},this.addStyle=function(){var e=document.createElement("style");e.type="text/css",e.innerHTML=["#publicPrompt{","position: fixed;z-index: 99999;top: 0;left: 0;width: 100%;height: 100%;","}","#publicPrompt .publicPrompt-mask{","position: absolute;top: 0;left: 0;width: 100%;height: 100%;","background-color: rgba(0,0,0,0.5);","}","#publicPrompt .publicPrompt-content{","position: absolute;z-index: 2;top: 30%;left: 50%;margin-left: -175px;","background-color: #fff;width: 350px;padding: 16px;","}","#publicPrompt .publicPrompt-content .publicPrompt-title{","font-size: 16px;color: #3D3D3D;","}","#publicPrompt .publicPrompt-title svg{margin-right:4px;}","#publicPrompt .publicPrompt-title .success{fill:#89cb62;width: 20px;height: 20px;vertical-align: sub;}","#publicPrompt .publicPrompt-close{","position: absolute;top: 16px;right: 16px;cursor: pointer;","}","#publicPrompt .publicPrompt-text{","text-align: center;margin-top: 16px;margin-bottom: 16px;font-size: 14px;","}","#publicPrompt .publicPrompt-text a{","color: #3399EA;text-decoration: underline;","}","#publicPrompt .publicPrompt-qr{","display: block;width: 116px;height: 116px;padding: 8px;margin: 0 auto;border: 1px solid #EBEBEB;","}",".publicPrompt-footer-text{","font-size: 14px;color: #4D4D4D;margin-top:8px;text-align: center;","}"].join(""),document.getElementsByTagName("head")[0].appendChild(e)}}window.csdn?window.csdn:{},window.csdn.publicPrompt=e}),$(function(){var e=$("#recommendNps"),t=$("#recommendNps .newnps-item"),o=$("#recommendNps .newnps-form-box");getCookie("blog_details_recommend_nps")?e.remove():(e.fadeIn(),t.on("click",function(){$(this).siblings().removeClass("active"),$(this).siblings().find("img.default").show(),$(this).siblings().find("img.active").hide(),$(this).addClass("active"),$(this).find("img.default").hide(),$(this).find("img.active").show(),o.slideDown()}),o.on("click",".newnps-btn",function(t){if(getCookie("UserName")){o.removeClass("active"),showToast({text:"感谢您的意见,我们尽快改进",bottom:"10%",zindex:9002,speed:500,time:1500});var n={spm:"1001.2101.3001.7836",extend1:"博客详情页相关推荐满意度调查",extra:JSON.stringify({radio:e.find(".newnps-item.active").data("type"),input:o.find(".newnps-input").val()})};setCookieBaseHour("blog_details_recommend_nps",(new Date).getTime(),720),window.csdn&&window.csdn.report&&window.csdn.report.reportClick(n),e.slideUp(600,function(){e.remove()})}else window.csdn.loginBox.show()}),o.on("focus",".newnps-input",function(){o.addClass("active")}))}),$(function(){function e(e,t){l.hide(),m=e,m?c.text("您举报的评论来自文章:"):c.text("举报内容:"),r.css({"z-index":9999}).show(),s.css({"z-index":1e4}).show()}function t(){s.find("#frmReport").trigger("reset"),r.css({"z-index":150}).hide(),s.hide(),$(".ipt-textarea").val(""),$(".box-botoom ul li").removeClass("box-active"),$(".box-content-bottom ul li").removeClass("box-active"),$(".box-content").eq(0).show().siblings().hide(),$("#cllcont").hide(),$(".content-input").val(""),flag=!1,i="",a=""}function o(e){showToast({text:e,bottom:"10%",zindex:9999,speed:500,time:1500})}var n=' 举报
选择你想要举报的内容(必选) - 内容涉黄
- 政治相关
- 内容抄袭
- 涉嫌广告
- 内容侵权
- 侮辱谩骂
- 样式问题
- 其他
';$("body").append(n);var i="",a="";$(".box-botoom ul li").on("click",function(){flag=!1,$(this).addClass("box-active").siblings().removeClass("box-active"),i=$(this).attr("data"),$(".content-input").val(""),$(".box-content").eq($(this).index()).show().siblings().hide(),"6"==$(this).attr("data")?$("#cllcont").hide():$("#cllcont").show(),"8"==$(this).attr("data")?$("#cllcont").hide():$("#cllcont").show(),$(".ipt-textarea")[0].value="",$(".box-content-bottom ul li").removeClass("box-active"),"7"==$(this).attr("data")?$(".box-content-span").html("补充说明(必填)"):$(".box-content-span").html("补充说明(选填)"),a=""}),$(".box-content-bottom ul li").on("click",function(){$(this).addClass("box-active").siblings().removeClass("box-active"),a=$(this).attr("sub_type"),flag=!0});var s=$("div.report-box"),c=s.find("#reptTit"),r=$("div.mask-dark"),l=$("#rptOriginalurl"),d=s.find('textarea[name="description"]'),m=!1,p=0;s.find(".btn-close").click(t),r.click(t);var u="";$(".box-active").on("click",function(){if(!i)return o("请选择你想要举报的内容!"),!1;switch(i){case"3":if(u=$("#originalurl").val(),""==u||"http://"==u)return o("举报抄袭必须提供原创文章地址!"),$("#originalurl").focus(),!1;break;case"7":if(u=d.val(),!u)return o("请填写补充说明!"),d.focus(),!1;break;case"5":if(!flag)return o("请选择具体原因"),!1;break;case"6":if(!flag)return o("请选择具体原因"),!1;break;case"8":if(!flag)return o("请选择具体原因"),!1}var e={articleId:articleId,commentId:m?p:"",subType:a,type:i,originalUrl:u,description:d.val()},n=m?"report-comment":"report-article";$.ajax({url:blogUrl+"/phoenix/web/v1/"+n,type:"post",dataType:"json",data:e,xhrFields:{withCredentials:!0},success:function(e){200==e.code?(t(),sessionStorage.removeItem("usename"),sessionStorage.removeItem("articleId"),o("感谢您的举报,我们会尽快审核!"),$(".ipt-textarea").val(""),$(".box-botoom ul li").removeClass("box-active"),$(".box-content-bottom ul li").removeClass("box-active"),$(".box-content").eq(0).show().siblings().hide(),$("#cllcont").hide(),$(".content-input").val(""),flag=!1,i="",a="",u="",t()):o("举报失败")}})}),$("div.comment-box").on("click","a.btn-report",function(){p=$(this).parents("li.comment-line-box").data("commentid")}),window.showReport=e}),$(function(){}),$(function(){function e(){$("code.has-numbering").each(function(e,t){$(t).css("position","absolute"),$(t).parent("pre.prettyprint").css({position:"relative",height:$(t).outerHeight()+20+"px"})})}window.csdn=window.csdn?window.csdn:{},window.csdn.setSafariCodestyle=e}),$(function(){0==$(".btn-readmore").length&&($("#content_views").find("pre").each(function(e,t){t=$(t),t.height()>340&&(t.addClass("set-code-hide"),t.append(''))}),$(window).resize().scroll(),$(document).on("click",".hide-preCode-bt",function(){return $(this).parents("pre").removeClass("set-code-hide"),$(this).parents(".hide-preCode-box").hide().remove(),$(window).resize().scroll(),window.csdn.report&&"function"==typeof window.csdn.report.reportClick&&window.csdn.report.reportClick({spm:"1001.2101.3001.7365"}),!1}))}),$(function(){function e(e,t,n){var i=new Date,a=(i.getTime(),o(i,n)),s=new Date;s.setTime(a),document.cookie=e+"="+t+";expires="+s.toGMTString()+";domain=.csdn.net;path=/"}function t(e){return document.cookie.length>0&&(c_start=document.cookie.indexOf(e+"="),c_start!=-1)?(c_start=c_start+e.length+1,c_end=document.cookie.indexOf(";",c_start),c_end==-1&&(c_end=document.cookie.length),unescape(document.cookie.substring(c_start,c_end))):null}function o(e,t){var o=t.split(":"),n=parseInt(o[0]),i=parseInt(o[1]),a=parseInt(o[2]);e.setHours(n),e.setMinutes(i),e.setSeconds(a);var s=Date.parse(e);return s}var n=$("#overTheScreen"),i=$(".over-the-screen-close");!currentUserName&&showPcWindowAd&&(t("over_the_screen")||(n.fadeIn(),setTimeout(function(){i.fadeIn()},500),e("over_the_screen",(new Date).getTime(),"24:00:00"))),$(".over-the-screen-close").on("click",function(){n.fadeOut()}),document.addEventListener("visibilitychange",function(){n.fadeOut()},!1)}),window.csdn.insertcallbackBlock=computePos,$(function(){function e(){var e=document.referrer;if(e&&!isShowToQuestion&&e.indexOf("so.csdn.net")>-1){var o='
搜索 ';$(".csdn-side-toolbar").prepend(o);var n=' '+s+'否是 ';if($(".csdn-side-toolbar .search").append(n),!getCookie("referrer_search")){var i=0;timer=setInterval(function(){i++,3==i&&$(".side-search-box").fadeIn(1500),7==i&&($(".side-search-box").fadeOut(1500),clearInterval(timer))},1e3),t("referrer_search",(new Date).getTime(),2)}$(".csdn-side-toolbar .search").on("click",function(e){getCookie("referrer_search")||clearInterval(timer),window.csdn.report&&"function"==typeof window.csdn.report.reportClick&&window.csdn.report.reportClick({spm:"1001.2101.3001.5543",dest:articleDetailUrl,extend1:s}),$(".side-search-box").fadeIn(500),setTimeout(function(){$(".side-search-box").fadeOut(1500)},1e4)}),$(".side-search-box .search-bt").on("click",function(e){getCookie("referrer_search")||clearInterval(timer);var t="";t="yes"===$(e.target).data("type")?"yes":"no",window.csdn.report&&"function"==typeof window.csdn.report.reportClick&&(window.csdn.report.reportClick({spm:"1001.2101.3001.5543",dest:articleDetailUrl,extend1:s,ab:t}),e.stopPropagation()),$(".side-search-box .side-search-content").html("感谢您的反馈!").css({width:"92px"}),setTimeout(function(){$(".csdn-side-toolbar .search").fadeOut(800,function(){$(this).remove()})},1e3)})}}function t(e,t,o){var n=new Date;n.setTime(n.getTime()+36e5*o),document.cookie=e+"="+escape(t)+";expires="+n.toGMTString()+";domain=.csdn.net;path=/"}function o(){if(isShowToQuestion){var e='
提问 ';$(".csdn-side-toolbar").prepend(e);var t='',o="";$.each(m,function(e,t){o+=' '+t.time+' '+t.username+' 解决了问题: '+t.question+" "}),$(".csdn-side-toolbar .question").append(t),$(".csdn-side-toolbar .question-tip-content").append(o),$(".question-tip-txt:first").siblings().hide(),setInterval(function(){$(".question-tip-txt:visible").slideUp("slow",function(){void 0===$(this).next(".question-tip-txt")[0]?$(".question-tip-txt:first").fadeIn("slow"):$(this).next(".question-tip-txt").fadeIn("slow")})},2e3);var i=document.documentElement.scrollTop||document.body.scrollTop;n(i,d)}}function n(e,t){c&&e>.5*t&&$(".csdn-side-toolbar .side-question-box").length>0&&(getCookie("blog_ask_question")||($(".csdn-side-toolbar .side-question-box").fadeIn(),l&&(window.csdn.report&&"function"==typeof window.csdn.report.reportView&&window.csdn.report.reportView({spm:"1001.2101.3001.6041"}),l=!1)))}function i(){if(isShowConcision){var e=' 
显示侧栏 ',t=' 
隐藏侧栏 ';$(".csdn-side-toolbar").prepend(e+t)}}function a(){if(isShowConcision&&isHasDirectoryModel){var e=' 
只看目录 ',t=' 
隐藏目录 ';$(".csdn-side-toolbar").prepend(e+t)}}getSideToolbarTime=setInterval(function(){$(".csdn-side-toolbar").length>0&&(clearInterval(getSideToolbarTime),e(),o(),i(),a())},1e3);var s="此内容解决你搜索的问题?";"control"===showSearchText&&(s="此内容是您要找的内容?"),"secondText"===showSearchText&&(s="此内容解决你搜索的问题?");var c=!0,r=!0,l=!0,d=document.documentElement.clientHeight,m=[{time:"5分钟前",username:"java小白_李同学",question:"给数组扩容失败求解答"},{time:"7分钟前",username:"叮当猫的风筝",question:"SSD训练迭代过程突然停止"},{time:"8分钟前",username:"不取名字了吧",question:"python selenium库相关函数在哪里找"},{time:"10分钟前",username:"冉水",question:"Vue使用Axios通过post方式访问后台,为什么后台获取不到传递过来的参数?"},{time:"12分钟前",username:"一袖如何两青蛇",question:"求解:为什么我的jupyter notebook无法运行代码"},{time:"13分钟前",username:"m0_53936501",question:"有关c++的一个问题不知哪里出错了求教?"},{time:"14分钟前",username:"zzzlj1",question:"利用指针编写程序,对具有6个元素的整型数组,找出其中最大值并计算出该数组的平均数。怎么写呀?"},{time:"20分钟前",username:"见过自讼",question:"关于java实现对象型数组的一个问题"},{time:"22分钟前",username:"chaochaoyaya",question:"C++中存入的数据和实际输出流的数据不一致,请教各位大佬这个如何解决呢?"},{time:"27分钟前",username:"赶鸭子",question:"如何求集合之间的交集(重复元素)?"},{time:"32分钟前",username:"iamalarak",question:"pip装不了东西,求教"},{time:"38分钟前",username:"nibiru0810",question:"PIP warning Ignoring Invalid distribution"},{time:"42分钟前",username:"godiegodieover",question:"PTA练习 C语言 删除行末空白字符"},{time:"50分钟前",username:"Playing with fire",question:"急救 vc代码应该怎样修改"},{time:"53分钟前",username:"weixin_39052466",question:"求教,C#调用C++dll接口出现问题,参数定义是否正确,调用方式是否正确"},{time:"1小时前",username:"小肥宅子",question:"Integer.parseInt()转换String类型 抛异常"},{time:"1小时前",username:"超哥",question:"女程序员提问:女程序员后台Java开发真的有描述的那么吃香么?之前被拒就是不要女性"},{time:"2小时前",username:"悠然岁月",question:"原代码复制重写,报以下错误,我也很奇怪这个dict到底是谁,怎么来的,传什么参?"},{time:"2小时前",username:"",question:"使用pip命令提示WARNING: Ignoring invalid distribution"}];window.onscroll=function(){var e=document.documentElement.scrollTop||document.body.scrollTop;n(e,d)},$(document).on("click",".csdn-side-toolbar .fade-question-box",function(){$(".csdn-side-toolbar .side-question-box").fadeOut(),t("blog_ask_question",(new Date).getTime(),72),c=!1}),$(document).on("mouseenter",".csdn-side-toolbar .question",function(e){$(".csdn-side-toolbar .side-question-box").fadeIn(),$(e.target).hasClass("ask_question_img")&&r&&"block"==$(".csdn-side-toolbar .side-question-box").css("display")&&(window.csdn.report&&"function"==typeof window.csdn.report.reportView&&window.csdn.report.reportView({spm:"1001.2101.3001.6041"}),r=!1)}),$(document).on("mouseleave",".csdn-side-toolbar .question",function(e){r=!0}),$(document).on("click",".csdn-side-toolbar .question",function(e){window.open("https://ask.csdn.net/new?spm=1001.2101.3001.6040")}),$(document).on("click",".csdn-side-toolbar .side-question-box",function(e){e.stopPropagation()}),$(document).on("click",".csdn-side-toolbar .sidecolumn",function(e){var t=$(this).data("type");"show"==t?(isShowDirectoryModel||($("#rightAsideConcision").removeClass("show-directory"),$(".directory.directory-hide").hide(),$(".directory.directory-show").show()),isShowSideModel=!1,$(".main_father").removeClass("mainfather-concision"),$(".main_father .container").removeClass("container-concision"),$(".sidecolumn.sidecolumn-show").hide(),$(".sidecolumn.sidecolumn-hide").show(),setCookieBaseHour("blog_details_concision",(new Date).getTime(),24)):(isShowDirectoryModel||($("#rightAsideConcision").addClass("show-directory"),$(".directory.directory-hide").show(),$(".directory.directory-show").hide()),$(".main_father").addClass("mainfather-concision"),$(".main_father .container").addClass("container-concision"),isShowSideModel=!0,$(".sidecolumn.sidecolumn-hide").hide(),$(".sidecolumn.sidecolumn-show").show(),setCookieBaseHour("blog_details_concision",0,24)),window.csdn.fixedSidebar.stopListener=!$(".main_father").hasClass("mainfather-concision")}),$(document).on("click",".csdn-side-toolbar .directory",function(e){var t=$(this).data("type");"show"==t?(isShowSideModel||($("#rightAsideConcision").addClass("show-directory"),$(".main_father").addClass("mainfather-concision"),$(".main_father .container").addClass("container-concision"),$(".sidecolumn.sidecolumn-hide").hide(),$(".sidecolumn.sidecolumn-show").show()),isShowDirectoryModel=!1,$(".directory.directory-show").hide(),$(".directory.directory-hide").show(),$("#rightAsideConcision").addClass("show-directory")):(isShowDirectoryModel=!0,$(".directory.directory-hide").hide(),$(".directory.directory-show").show(),$("#rightAsideConcision").removeClass("show-directory")),window.csdn.fixedSidebar.stopListener=!$(".main_father").hasClass("mainfather-concision"),setCookieBaseHour("blog_details_concision",0,24)})});var getRecommendListUrlArr=null;$("#recommend-item-box-tow").children().length<=0&&$("#recommend-item-box-tow").remove(),baiduKey?csdn.afterCasInit=function(e,t){if(!e)return!1;var o="";4==articleSource&&$("#recommendDown .recommend_down").length<=0?csdn.baiduSearch(e,function(t){if(needInsertBaidu&&isRecommendModule)if(t&&t.length)showDownRecommend(t[0]);else{var n=$(".recommend-box .type_download")[0];if(n&&$(n).length){var i=$(n).find("a")[0],a={linkUrl:$(n).data("url"),title:$(i).text()};showDownRecommend(a)}}csdn.baiduSearch(e,function(e){needInsertBaidu&&isRecommendModule?(showResult(e,o),getQueryIdx(),reportTop10()):(getQueryIdx(),reportTop10())})},"download.csdn.net"):csdn.baiduSearch(e,function(e){needInsertBaidu&&isRecommendModule?(showResult(e,o),getQueryIdx(),reportTop10()):(getQueryIdx(),reportTop10())})}:(getQueryIdx(),reportTop10());var articleTitleContent=$("#articleContentId").text().replace(/[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘',。、<\/em>"]/g,"").replace(/\s/g,"").toLowerCase();$(function(){function e(){var e=$("#toolBarBox").offset().top,t=$("#toolBarBox").offset().left,o=$(".left-toolbox").height(),n=$("#toolBarBox").width(),i=window.innerHeight,a=document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop;e+o-i-a>0?($("#toolBarBox .left-toolbox").css({position:"fixed","z-index":"996",left:t+"px",bottom:"0",width:n+"px"}),$("#toolBarBox").addClass("more-toolbox-active")):($("#toolBarBox .left-toolbox").css({position:"relative","z-index":"996",left:"0px",bottom:"0",width:n+"px"}),$("#toolBarBox").removeClass("more-toolbox-active"))}function t(e,t){if(T.skinBoxshadow.html(""),e){var o=' '+t+" ";T.skinBoxshadow.append(o)}else{var n=' '+t+" ";T.skinBoxshadow.append(n)}T.skinBoxshadow.fadeIn(200),setTimeout(function(){T.skinBoxshadow.fadeOut(200),T.skinBoxshadow.html("")},1500)}function o(e,t){t?e.addClass("active"):e.removeClass("active")}function n(e){getCookie("UserName")?$.ajax({url:blogUrl+"/phoenix/web/v1/article/like",type:"post",dataType:"json",data:{articleId:articleId},xhrFields:{withCredentials:!0},success:function(n){if(200==n.code){if(n.data.status)$("#is-like-img").hide(),$("#is-like-imgactive").show(),isLikeStatus=!0,isUnLikeStatus&&e&&i(!1),o($("#spanCount"),!0),$("#spanCount")[0].style="color:#fc5531 !important;",window.csdn.report&&"function"==typeof window.csdn.report.reportClick&&window.csdn.report.reportClick({mod:"1582594662_001",spm:"1001.2101.3001.4241",dest:"",extend1:'{"praise":1}'});else{$("#is-like-imgactive").hide(),$("#is-like-img").show(),isLikeStatus=!1,e&&i(!1),o($("#spanCount"),!1);var a="color:#999999 !important;";"Black"===skinStatus&&(a="color:#ccccd8 !important;"),$("#spanCount")[0].style=a,window.csdn.report&&"function"==typeof window.csdn.report.reportClick&&window.csdn.report.reportClick({mod:"1582594662_001",spm:"1001.2101.3001.4241",dest:"",extend1:'{"praise":0}'})}$("#spanCount").text(n.data.like_num>0?n.data.like_num:"")}else t(!1,n.message);C()}}):window.csdn.loginBox.show({spm:"1001.2101.3001.8604"})}function i(e){getCookie("UserName")?$.ajax({url:blogUrl+"/phoenix/web/v1/article/bury",type:"post",dataType:"json",data:{articleId:articleId},xhrFields:{withCredentials:!0},success:function(o){200==o.code?o.data.status?($("#is-unlike-img").hide(),$("#is-unlike-imgactive").show(),isUnLikeStatus=!0,isLikeStatus&&e&&n(!1),window.csdn.report&&"function"==typeof window.csdn.report.reportClick&&window.csdn.report.reportClick({spm:"1001.2101.3001.6669",extend1:'{"praise":1}'})):($("#is-unlike-imgactive").hide(),$("#is-unlike-img").show(),isUnLikeStatus=!1,e&&n(!1),window.csdn.report&&"function"==typeof window.csdn.report.reportClick&&window.csdn.report.reportClick({spm:"1001.2101.3001.6669",extend1:'{"praise":0}'})):t(!1,o.message)}}):window.csdn.loginBox.show({spm:"1001.2101.3001.8605"})}function a(){window.csdn.loginBox.key({biz:"blog",subBiz:"other_service",cb:function(){$.ajax({url:blogUrl+"/phoenix/web/v1/collect",dataType:"json",type:"POST",xhrFields:{withCredentials:!0},data:{articleId:articleId},success:function(e){200===e.code&&s(e.data.status)},error:function(){}})}})}function s(e){e?($("#is-collection-imgactive").show(),$("#is-collection-img").hide(),o($("#get-collection"),!0),$("#blog_detail_zk_collection .un-collect-status").hide(),$("#blog_detail_zk_collection .collect-status").show(),B&&(B=!1,$(".get-collection").text()?$(".get-collection").text(1*$("#get-collection").text()+1):$(".get-collection").text("1"))):($("#is-collection-imgactive").hide(),$("#is-collection-img").show(),o($("#get-collection"),!1),"White"==skinStatus?$(".get-collection").css({color:"#999aaa"}):$(".get-collection").css({color:"#999999"}),$("#blog_detail_zk_collection .un-collect-status").show(),$("#blog_detail_zk_collection .collect-status").hide(),B=!0,$(".get-collection").text()?1*$("#get-collection").text()-1<=0?$(".get-collection").text(""):$(".get-collection").text(1*$("#get-collection").text()-1):$(".get-collection").text("")),C()}function c(){getCookie("UserName")&&$.ajax({url:blogUrl+"phoenix/web/v1/isCollect",type:"GET",xhrFields:{withCredentials:!0},data:{articleId:articleId},success:function(e){200===e.code&&s(e.data.status),C()}})}function r(e,t,o){o.length&&$.ajax({type:"GET",url:blogUrl+e,dataType:"json",xhrFields:{withCredentials:!0},data:{articleId:articleId},success:function(e){200==e.code&&t(e.data,o)},error:function(e){}})}function l(e,t){var o="";if(e.list&&e.list.length){if(o='",o+=''+(e.total>10?"等":"")+''+e.total+"人已打赏",t.html(o),T.rewardContent.show(),T.initHeighgt=50,p())var n=422;else var n=521;$(".tool-item-reward .count").html(e.total),T.rewardNew.css({"max-height":n+T.initHeighgt+"px"})}else T.rewardContent.hide(),T.initHeighgt=0}function d(e,t){Number(e)-Number(t)<0?T.sureBoxBlance.addClass("active"):T.sureBoxBlance.removeClass("active")}function m(){$.ajax({url:"https://mall.csdn.net/mp/mallorder/api/internal/wallet/polymerize",type:"GET",xhrFields:{
withCredentials:!0},success:function(e){200==e.code&&e.data&&e.data.balance&&(T.blance=e.data.balance.normalAmount,T.domBlance.html("(余额:¥"+T.blance+" )"),d(T.blance,T.moneyNum))}})}function p(){var e=0;return T.payType.each(function(t,o){if($(o).hasClass("active"))return void(e=t)}),"blance"===T.payType.eq(e).data("type")}function u(e){T.sureBoxBlance.find(".tip").removeAttr("style",""),e.value||(e.value=2),T.moneyNum=e.value,d(T.blance,T.moneyNum),T.codeNum.html("¥"+T.moneyNum),0请在手机端操作",T.codeImgBox.html('
'+imgtext+"")}function g(e){showToast({text:e.errorMessage,bottom:"10%",zindex:9002,speed:500,time:1500})}function v(){T.codeImgBox.html(T.repeatAgain)}function w(e,t){var o=qrcode(6,"M");o.addData(e),o.make(),t.html(o.createImgTag(3,3))}function b(e,t){w(t.pay_url,T.codeImgBox)}function x(){T.rewardNew.fadeOut(),T.skinBoxshadow.html("");var e='
';T.skinBoxshadow.append(e),setTimeout(function(){r(T.ajaxRewardUrl,l,T.rewardContent),T.skinBoxshadow.fadeOut(200),T.skinBoxshadow.html("")},4e3)}function y(e){if(getCookie("UserName")){var t=$(".tool-attend");t.is(".tool-unbt-attend")?(t.removeClass("tool-unbt-attend").addClass("tool-bt-attend").text("关注"),I&&(window.csdn.report&&"function"==typeof window.csdn.report.reportClick&&window.csdn.report.reportClick({mod:"1592215036_002",spm:"1001.2101.3001.4132",extend1:"已关注"}),I=!1)):(t.removeClass("tool-bt-attend").addClass("tool-unbt-attend").text("已关注"),I&&(window.csdn.report&&"function"==typeof window.csdn.report.reportClick&&window.csdn.report.reportClick({mod:"1592215036_002",spm:"1001.2101.3001.4132",extend1:"关注"}),I=!1),$(".profile-subscribe-box").length>0&&(window.csdn.report&&"function"==typeof window.csdn.report.reportClick&&"none"==$(".profile-subscribe-box").css("display")&&window.csdn.report.reportClick({spm:"1001.2101.3001.9148"}),$(".profile-subscribe-box").show()))}else window.csdn.loginBox.show({spm:"1001.2101.3001.8606"});C()}function C(){if("block"===$("#is-like-imgactive").css("display")&&"block"===$("#is-collection-imgactive").css("display")&&$(".tool-unbt-attend").length>0){if($("#health-companies").length){$("#health-companies").removeClass("active");var e=$("#health-companies").attr("src");e.indexOf("Default")>-1?$("#health-companies").attr("src",e):$("#health-companies").attr("src",e.replace("Active","Default"))}}else if($("#health-companies").length){$("#health-companies").addClass("active");var e=$("#health-companies").attr("src");e.indexOf("Default")>-1?$("#health-companies").attr("src",e.replace("Default","Active")):$("#health-companies").attr("src",e)}}$(document).on("mouseover",".article-bar-top .time",function(){if($(".article-info-box .up-time").length){var e=$(this).offset().left,t=($(this).width(),$(this).parents().find(".article-bar-top").offset().left);$(".article-info-box .up-time").css({left:e-t-20}).show()}}),$(document).on("mouseout",".article-bar-top .time",function(){$(".article-info-box .up-time").length&&$(".article-info-box .up-time").hide()});var k=!0;$(document).on("click",".article-info-box .slide-toggle",function(){k?$(this).text("收起"):$(this).text("版权"),$(this).parents(".article-info-box").find(".slide-content-box").slideToggle(),k=!k});var S='{"mod":"1585297308_001","spm":"1001.2101.3001.6548","dest":"'+articleDetailUrl+'","extend1":"pc","ab":"new"}';canRead&&($(".hide-article-box").length?$(document).on("click",".hide-article-box .btn-readmore",function(){$("#content_views").after("")}):$("#content_views").after("")),$("#blog_detail_zk_collection").click(function(){getCookie("UserName")?window.csdn.collectionBox.show(window.csdn.collectionBox.params):window.csdn.loginBox.show({spm:"1001.2101.3001.4130"})}),$("#tool-reward").on("click",function(){$("#reward").show()});var _=$("#tool-downloadpdf");_.length>0&&_.on("click",function(){setTimeout(function(){$(".blog-content-box").print()},500)}),$("#is-like").on("click",function(){isUnLikeStatus?i(!0):n(!1)}),$("#is-unlike").on("click",function(){isLikeStatus?n(!0):i(!1)}),$("#btn-readmore-zk").on("click",function(){$("#btn-readmore").show()}),$("#btn-readmore").on("click",function(){var t=$(window).height();t*$(this).attr("height");$(".hide-article-box").show(),$("div.article_content")[0].style="height:2000px; overflow: hidden;",e(),$("#btn-readmore").hide(),$(".btn-readmore-gz")&&$(".btn-readmore-gz span").text("阅读全文")}),$(document).on("click",".is-collection > a.tool-item-href",function(){getCookie("UserName")?window.csdn.collectionBox.show(window.csdn.collectionBox.params):window.csdn.loginBox.show({spm:"1001.2101.3001.4130"})}),$(document).on("click",".btn-change-collect",function(){getCookie("UserName")?window.csdn.collectionBox.show(window.csdn.collectionBox.params):window.csdn.loginBox.show({spm:"1001.2101.3001.4130"})}),$(document).on("click",".tool-more .article-report",function(){getCookie("UserName")?showReportNew(!1,articleTitles):window.csdn.loginBox.show()}),e(),$(window).scroll(function(){e()}),$(window).resize(function(){e()}),$(document).on("click",".csdn-side-toolbar .option-box",function(t){isShowConcision&&setTimeout(function(){e()},100)}),$(".btn-readmore").click(e);var B=!0;window.csdn.collectionBox.params={url:curentUrl,title:articleTitle,description:articleDesc,author:username,source_id:articleId,source:"blog",collectionCallBack:function(e){s(e)}},c();var T={blance:"",rewardBtNew:$("#rewardBtNew"),rewardNew:$("#rewardNew"),rewardContent:$(".reward-box-new .reward-content"),skinBoxshadow:$(".skin-boxshadow"),rewardClose:$(".reward-popupbox-new .reward-close"),sureBoxBlance:$(".reward-popupbox-new .sure-box-blance"),moneyNum:2,payType:$(".reward-popupbox-new .pay-type"),domBlance:$(".reward-popupbox-new .pay-type-num"),rewardBt:$(".reward-popupbox-new .reward-sure"),chooseMoney:$(".reward-popupbox-new .choose-money"),customizeMoney:$(".reward-popupbox-new .customize-money"),customizeTip:$(".reward-popupbox-new .customize-tip"),isShowCode:$(".reward-popupbox-new .sure-box-money"),codeNum:$(".reward-popupbox-new .code-num"),codeImgBox:$(".reward-popupbox-new .code-img-box"),payrun:'
获取中',repeatAgain:'
点击重新获取',ajaxRewardUrl:"phoenix/web/v1/reward/article-users",initHeighgt:0};T.rewardBtNew.on({click:function(){getCookie("UserName")?getCookie("UserName")!==username?(r(T.ajaxRewardUrl,l,T.rewardContent),m(),T.skinBoxshadow.fadeIn(),T.rewardNew.fadeIn()):showToast({text:"自己不能打赏自己",bottom:"10%",zindex:9002,speed:500,time:1500}):window.csdn.loginBox.show({spm:"1001.2101.3001.4237"})}}),T.rewardClose.on("click",function(e){T.rewardNew.fadeOut(),T.skinBoxshadow.fadeOut();var t=e||window.e;t&&t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}),T.payType.click(function(){T.payType.removeClass("active"),$(this).addClass("active"),p()?(d(T.blance,T.moneyNum),T.isShowCode.slideUp(500),T.sureBoxBlance.slideDown(500,function(){T.sureBoxBlance.find(".tip").html('您的余额不足,请更换扫码支付或充值')}),T.rewardNew.animate({"max-height":422+T.initHeighgt+"px"},500)):(T.codeNum.html("¥"+T.moneyNum),T.sureBoxBlance.find(".tip").html(""),T.isShowCode.slideDown(500),T.sureBoxBlance.slideUp(500),T.rewardNew.animate({"max-height":521+T.initHeighgt+"px"},500),h())}),T.chooseMoney.click(function(){T.chooseMoney.removeClass("choosed"),T.customizeMoney.removeClass("active"),T.customizeMoney.attr("placeholder","自定义"),T.customizeMoney.val(""),$(this).addClass("choosed"),T.moneyNum=$(this).data("id"),T.codeNum.html("¥"+T.moneyNum),p()?d(T.blance,T.moneyNum):h()}),T.customizeMoney.on({focus:function(){T.chooseMoney.removeClass("choosed"),$(this).addClass("active"),$(this).attr("placeholder","1-500"),p()&&(T.sureBoxBlance.addClass("active"),T.sureBoxBlance.find(".tip").css({display:"none"}))},input:function(){$(this)[0].value=$(this)[0].value.replace(/^(0+)|[^\d]+/g,""),$(this)[0].value?($(this)[0].value>500&&($(this)[0].value=2,T.customizeTip.fadeIn(1e3,function(){T.customizeTip.fadeOut(1e3)})),d(T.blance,$(this)[0].value),T.sureBoxBlance.find(".tip").removeAttr("style","")):p()&&(T.sureBoxBlance.addClass("active"),T.sureBoxBlance.find(".tip").css({display:"none"}))},blur:function(){u($(this)[0])}}),T.customizeMoney.on("keydown",function(e){var t=e||event;13==t.which&&u($(this)[0])}),T.rewardBt.on("click",function(e){if(getCookie("UserName"))if(initRewardObject&&""!=initRewardObject.sign){if(!T.sureBoxBlance.hasClass("active")&&"none"!==T.sureBoxBlance.css("display")&&p&&00&&$(".subscribe-img-close").on("click",function(e){$(".profile-subscribe-box").hide()}),$("#health-companies").on("click",function(){getCookie("UserName")?$(this).hasClass("active")&&(window.csdn.report&&"function"==typeof window.csdn.report.reportClick&&window.csdn.report.reportClick({spm:"1001.2101.3001.4429"}),"block"==$("#is-like-img").css("display")&&(isUnLikeStatus?i(!0):n(!1)),"block"==$("#is-collection-img").css("display")&&a(),$(".tool-bt-attend").length>0&&($(".tool-attend").trigger("click"),window.csdn.report&&"function"==typeof window.csdn.report.reportClick&&window.csdn.report.reportClick({mod:"1592215036_002",spm:"1001.2101.3001.4132",extend1:"关注"})),$("#is-like-imgactive-animation-like").show().addClass("active-animation"),$("#is-collection-img-collection").show().addClass("active-animation"),$(".tool-item-follow").show().addClass("active-animation"),setTimeout(function(){$("#is-like-imgactive-animation-like").hide().removeClass("active-animation"),$("#is-collection-img-collection").hide().removeClass("active-animation"),$(".tool-item-follow").hide().removeClass("active-animation")},800)):window.csdn.loginBox.show()});var N=!0;$(".toolbox-list a.tool-item-href").on({mouseover:function(){if(N){var e=$(this).find("img.isdefault"),t=$(this).find("span.count");e.attr("src");"block"==e.css("display")?"White"==skinStatus?t.css({color:"#999999"}):t.css({color:"#999aaa"}):t.css({color:"#fc5531"}),N=!N}},mouseout:function(){if(!N){var e=$(this).find("img.isdefault"),t=$(this).find("span.count");e.attr("src");"block"==e.css("display")?"White"==skinStatus?t.css({color:"#999aaa"}):t.css({color:"#999999"}):t.css({color:"#fc5531"}),N=!N}}});var F=$("#shareBgIcon");F.length&&F.addClass("icon"+(Math.floor(5*Math.random())+1))}),$(function(){function e(e,t){var o=6,n=new Date;n.setTime(n.getTime()+36e5*o),document.cookie=e+"="+escape(t)+";expires="+n.toGMTString()+";domain=.csdn.net;path=/"}function t(e){var t,o=new RegExp("(^| )"+e+"=([^;]*)(;|$)");return(t=document.cookie.match(o))?unescape(t[2]):null}if(!currentUserName){var o=$("div.article_content"),n=o.offset().top,i=o.height(),a=document.body.clientHeight||document.documentElement.clientHeight,s=$(document).scrollTop();$(document).scroll(function(){s=$(document).scrollTop(),t("unlogin_scroll_step")||t("UserName")||showPcWindowAd||(s+a-n>i/2||s+a-n>2*a)&&(window.csdn.loginBox.show(),e("unlogin_scroll_step",(new Date).getTime()))})}}),"undefined"!=typeof document.addEventListener&&document.addEventListener("DOMContentLoaded",function(){return"undefined"==typeof Chart?void("undefined"!=typeof console&&console.log("ERROR: You must include chart.min.js on this page in order to use Chart.js")):void[].forEach.call(document.querySelectorAll("div.chartjs"),function(e){var t,o;t="undefined"!=typeof chartjs_colors?chartjs_colors:"undefined"!=typeof chartjs_colors_json?JSON.parse(chartjs_colors_json):{fillColor:"rgba(151,187,205,0.5)",strokeColor:"rgba(151,187,205,0.8)",highlightFill:"rgba(151,187,205,0.75)",highlightStroke:"rgba(151,187,205,1)",data:["#B33131","#B66F2D","#B6B330","#71B232","#33B22D","#31B272","#2DB5B5","#3172B6","#3232B6","#6E31B2","#B434AF","#B53071"]},o="undefined"!=typeof chartjs_config?chartjs_config:"undefined"!=typeof chartjs_config_json?JSON.parse(chartjs_config_json):{Bar:{animation:!1},Doughnut:{animateRotate:!1},Line:{animation:!1},Pie:{animateRotate:!1},PolarArea:{animateRotate:!1}};var n=e.getAttribute("data-chart"),i=JSON.parse(e.getAttribute("data-chart-value"));if(i&&i.length&&n){e.innerHTML="";var a=document.createElement("canvas");a.height=e.getAttribute("data-chart-height"),e.appendChild(a);var s=document.createElement("div");s.setAttribute("class","chartjs-legend"),e.appendChild(s);var c,r=a.getContext("2d"),l=new Chart(r);if("bar"!=n)for(c=0;c").addClass("pre-numbering").hide();for($(this).addClass("has-numbering").parent().append(t),i=1;i ").text(i));t.fadeIn(1700)}),$(".pre-numbering li").css("color","#999"),setTimeout(function(){$(".math").each(function(e,t){$(this).find("span").last().css("color","#fff")})}),setTimeout(function(){$(".toc a[target='_blank']").attr("target",""),$("a.reversefootnote,a.footnote").attr("target","")},500)},html_line:function(){function e(){$(".CopyToClipboard").each(function(){var e=new ZeroClipboard.Client;e.setHandCursor(!0),e.addEventListener("load",function(e){}),e.addEventListener("mouseOver",function(e){var t=e.movie.parentNode.parentNode.parentNode.parentNode.nextSibling.innerHTML;t=t.replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&"),e.setText(t)}),e.addEventListener("complete",function(e,t){alert("代码已经复制到你的剪贴板。")}),e.glue(this,this.parentNode)})}$(".article_content pre").each(function(){var e=$(this);try{if(e.attr("class").indexOf("brush:")!=-1){var t=e.attr("class").split(";")[0].split(":")[1];e.attr("name","code"),e.attr("class",t)}e.attr("class")&&e.attr("name","code")}catch(o){}}),$(".article_content textarea[name=code]").each(function(){var e=$(this);e.attr("class").indexOf(":")!=-1&&e.attr("class",e.attr("class").split(":")[0])}),$(".highlighter").each(function(e,t){hljs.highlightBlock(t),hljs.lineNumbersBlock(t)}),window.clipboardData||setTimeout(e,1e3)}},s=$(".markdown_views")[0];s?(a.markdown_line(),/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&window.csdn.setSafariCodestyle()):a.html_line(),$(document).on("click",".input-mod",function(){$(".select-option").show(),$(".select-button").removeClass("rotate0").addClass("rotate180")}),$(document).on("input porpertychange",".private-input",function(){n(),$(this).val().length>120&&$(this).val($(this).val().substr(0,120)),$(".textarea-box .number").text(120-$(this).val().length),$(this).val().length>0&&$(".private-form").removeClass("no-active").addClass("active")}),$(document).on("click",".select-option li",function(){$(".super-private").height(126),$(".private-content .other").hide(),n(),$(".select-active").text($(this).text()).data("index",$(this).data("index")),$(this).data("isinput")?($(".super-private").height(240),$(".private-content .other").show()):$(".private-form").removeClass("no-active").addClass("active"),$(".select-button").addClass("rotate0").removeClass("rotate180"),$(".select-option").fadeOut()}),$(document).on("click",".select-button",function(){"block"===$(".select-option").css("display")?($(".select-option").fadeOut(),$(this).removeClass("rotate180").addClass("rotate0")):($(this).removeClass("rotate0").addClass("rotate180"),$(".select-option").fadeIn()),e.stopPropagation(),e.cancelBubble=!0}),$(document).on("click",".private-close, .close-active",function(){$(".super-private").hide(),$(".mask-dark").hide()}),$(document).on("click",".private-footer .active",function(){var e=$(".select-active").data("index"),o=$(".reason").val();e||alert("请选择原因"),text="text",t(articleId,e,o)})}),$(function(){$("article").find("table").map(function(){$(this).wrap('')})}),!function(e){function t(){var t=navigator.userAgent.toLowerCase();return e.ActiveXObject||"ActiveXObject"in e?"ie":t.indexOf("firefox")>=0?"firefox":t.indexOf("chrome")>=0?"chrome":t.indexOf("opera")>=0?"opera":t.indexOf("safari")>=0?"safari":void 0}var o=e.document,n=function(t,n,i,a,s,c){function r(e,o,i){var a=(e+o)/2;if(i<=0||o-e=0?"win":e.indexOf("mac")>=0?"mac":void 0}function round2(number,fractionDigits){with(Math)return round(number*pow(10,fractionDigits))/pow(10,fractionDigits)}function iszoom(e){return"win"==e.system&&1!=e.zoom||("mac"==e.system&&e.zoom%1!=0&&e.zoom%2!=0||void 0)}function keyUpEvent(e){var t={win:{add:187,minus:189,origin:48},mac:{add:187,minus:189,origin:48}},o=t[system()];if(e.ctrlKey||e.metaKey)if(e.keyCode==o.add||e.keyCode==o.minus){var n={zoom:round2(detectZoom(),2),system:system()};LeftPopShow(iszoom(n),leftPopRendering,RenderData)}else e.keyCode!=o.add&&e.keyCode!=o.origin||BOXDOM.animate(CLOSEANI,2e3)}function keydownEvent(e){setTimeout(keyUpEvent,300,e)}function setStorage(e,t){return localStorage.setItem(e,t)}function getStorage(e){return localStorage.getItem(e)}function addStyles(e){var t=document.createElement("style");t.type="text/css",t.innerHTML=[".leftPop{width:330px;position: fixed;font-size: 12px;","box-shadow: 0 4px 8px 0 rgba(0,0,0,0.10);padding:16px 40px 16px 16px;z-index: 100;","}",".leftPop .leftPop-close{position: absolute;right: 20px;"+e,"cursor: pointer;","}"].join(""),document.getElementsByTagName("head")[0].appendChild(t)}function leftPopRendering(e){var t=$(".leftPop");if(t.length>0)return t.stop(!0,!1).animate(e.animate,e.animateTime),!1;var o='';t=$(''+o+""),addStyles(e.closeColor),t.append(e.template).css(e.style),t.appendTo($("body")).delay(2e3).animate(e.animate,e.animateTime),BOXDOM=t,$(".leftPop-close").on("click",function(){t.stop(!0,!1).animate(e.closeAnimate,e.animateTime),setStorage("leftPop",0)})}function LeftPopShow(e,t,o){var n=getStorage("leftPop");e&&null==n?t(o):BOXDOM.stop(!0,!1).animate(o.closeAnimate,o.animateTime)}function ChangeRatio(){var e=0,t=window.screen,o=navigator.userAgent.toLowerCase();return void 0!==window.devicePixelRatio?e=window.devicePixelRatio:~o.indexOf("msie")?t.deviceXDPI&&t.logicalXDPI&&(e=t.deviceXDPI/t.logicalXDPI):void 0!==window.outerWidth&&void 0!==window.innerWidth&&(e=window.outerWidth/window.innerWidth),e&&(e=Math.round(100*e)),e}var zoomData={zoom:round2(detectZoom(),2),system:system()},BOXDOM=$("leftPop");CLOSEANI={right:"-100%"};var events={win:{even:"keyup",fun:keyUpEvent},mac:{even:"keydown",fun:keydownEvent}};$(window).on(events[system()].even,events[system()].fun);var RenderData={template:"你的浏览器目前处于缩放状态,页面可能会出现错位现象,建议100%大小显示。",style:{right:"-100%","background-color":"#EBF5FD",top:"100px","border-left":"4px solid #70B8F0"},closeColor:"fill:#70B8F0;",animate:{right:0},closeAnimate:CLOSEANI,animateTime:2e3}});