You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
14 KiB

2 years ago
"use strict";function _classCallCheck(e,i){if(!(e instanceof i))throw new TypeError("Cannot call a class as a function")}var _createClass=function(){function e(e,i){for(var n=0;n<i.length;n++){var s=i[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}return function(i,n,s){return n&&e(i.prototype,n),s&&e(i,s),i}}();!function(e,i){function n(e){for(var i=document.cookie.split("; "),n=0;n<i.length;n++){var s=i[n].split("=");if(s[0]==e)return decodeURIComponent(s[1])}}function s(){return/(phone|pad|pod|iphone|ipod|ios|ipad|android|mobile|blackberry|iemobile|mqqbrowser|juc|fennec|wosbrowser|browserng|webos|symbian|windows phone|csdn|MicroMessenger)/i.test(navigator.userAgent)}function o(){return/iP(ad|hone|od)/.test(navigator.userAgent)}var t="https://img-home.csdnimg.cn/images/20210426071127.png";e.csdn=e.csdn||{},function(e){var i=document.createElement("link");i.rel="stylesheet",i.type="text/css",i.href="https://g.csdnimg.cn/user-login/3.0.0/user-login.css",document.getElementsByTagName("head")[0].appendChild(i)}();var r=function(){function r(){_classCallCheck(this,r),this.isMobile=s(),this.mobileAreaCodeList=[],this.isRisk=!1,this.countDownTime=60,this.isCountDownStart=!1,this.callBackFn=null,this.verifyCode="",this.mobile="",this.code="86",this.codeReg=/^[1][3,4,5,6,7,8,9][0-9]{9}$/,this.verifyCodeType=1,this.timer=null}return _createClass(r,[{key:"getUserStatus",value:function(s){var o=this;this.callBackFn=s,i.ajax({url:"https://passport.csdn.net/v1/api/check/userstatus",type:"POST",contentType:"application/json",xhrFields:{withCredentials:!0},data:JSON.stringify({username:n("UserName")||""}),dataType:"json",success:function(i){if(i.status)if(a.result=i,i.detail)switch(i.detail){case"deleted":o.renderDeletedPopup();break;case"riskControl":o.getUserMobile(o.renderRiskControlPopup);break;case"activateAndRisk":o.isRisk=!0,o.getMobileAreaCode(o.renderActivatePopup);break;case"activate":o.getMobileAreaCode(o.renderActivatePopup);break;default:return!0}else o.executeCallBack();else e.location.href="https://passport.csdn.net/account/login"},error:function(e){console.log(e)}})}},{key:"getUserMobile",value:function(e){var n=this;i.ajax({url:"https://passport.csdn.net/v1/api/riskControl/getUserMobile",type:"POST",contentType:"application/json",xhrFields:{withCredentials:!0},dataType:"json",success:function(i){i.status&&e&&e.call(n,i.data)},error:function(e){console.log(e)}})}},{key:"getMobileAreaCode",value:function(e){var n=this;i.ajax({url:"https://passport.csdn.net/v1/api/get/mobileAreaCode",type:"POST",contentType:"application/json",xhrFields:{withCredentials:!0},dataType:"json",success:function(i){i.status&&(n.mobileAreaCodeList=i.data,e&&e.call(n))},error:function(e){console.log(e)}})}},{key:"sendVerifyCode",value:function(e,n){var s=this,o=1===n?"sendVoiceVerifyCode":"sendVerifyCode";i.ajax({url:"https://passport.csdn.net/v1/api/riskControl/"+o,type:"POST",contentType:"application/json",xhrFields:{withCredentials:!0},dataType:"json",success:function(i){i.status?e&&e.call(s):s.showError(i.message)},error:function(e){s.showError(e.responseJSON.message)}})}},{key:"checkVerifyCode",value:function(e){var n=this,s=1===e?"checkVoiceVerifyCode":"checkVerifyCode",o={verifyCode:this.verifyCode};i.ajax({url:"https://passport.csdn.net/v1/api/riskControl/"+s,type:"POST",contentType:"application/json",data:JSON.stringify(o),xhrFields:{withCredentials:!0},dataType:"json",success:function(e){e.status?n.executeCallBack():n.showError(e.message)},error:function(e){n.showError(e.responseJSON.message)}})}},{key:"sendBindVerifyCode",value:function(e,n){var s=this,o={mobile:this.mobile,code:"00"+this.code},t=1===n?"sendBindVoiceCode":"sendBindVerifyCode";i.ajax({url:"https://passport.csdn.net/v1/api/riskControl/"+t,type:"POST",contentType:"application/json",data:JSON.stringify(o),xhrFields:{withCredentials:!0},dataType:"json",success:function(i){i.status?e&&e.call(s):s.showError(i.message)},error:function(e){s.showError(e.responseJSON.message)}})}},{key:"checkBindVerifyCode",value