12345678 |
- (self["webpackChunkvue_antd_pro"]=self["webpackChunkvue_antd_pro"]||[]).push([[806],{3939:function(t){(function(){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(t,e){return t<<e|t>>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&n.rotl(t,8)|4278255360&n.rotl(t,24);for(var e=0;e<t.length;e++)t[e]=n.endian(t[e]);return t},randomBytes:function(t){for(var e=[];t>0;t--)e.push(Math.floor(256*Math.random()));return e},bytesToWords:function(t){for(var e=[],n=0,r=0;n<t.length;n++,r+=8)e[r>>>5]|=t[n]<<24-r%32;return e},wordsToBytes:function(t){for(var e=[],n=0;n<32*t.length;n+=8)e.push(t[n>>>5]>>>24-n%32&255);return e},bytesToHex:function(t){for(var e=[],n=0;n<t.length;n++)e.push((t[n]>>>4).toString(16)),e.push((15&t[n]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],n=0;n<t.length;n+=2)e.push(parseInt(t.substr(n,2),16));return e},bytesToBase64:function(t){for(var n=[],r=0;r<t.length;r+=3)for(var i=t[r]<<16|t[r+1]<<8|t[r+2],o=0;o<4;o++)8*r+6*o<=8*t.length?n.push(e.charAt(i>>>6*(3-o)&63)):n.push("=");return n.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var n=[],r=0,i=0;r<t.length;i=++r%4)0!=i&&n.push((e.indexOf(t.charAt(r-1))&Math.pow(2,-2*i+8)-1)<<2*i|e.indexOf(t.charAt(r))>>>6-2*i);return n}};t.exports=n})()},51126:function(t,e,n){"use strict";n.r(e),n.d(e,{default:function(){return C}});var r=function(){var t=this,e=t._self._c;return e("div",{staticClass:"main"},[e("a-form",{ref:"formLogin",staticClass:"user-layout-login",attrs:{id:"formLogin",form:t.form},on:{submit:t.handleSubmit}},[t.isLoginError?e("a-alert",{staticStyle:{"margin-bottom":"24px"},attrs:{type:"error",showIcon:"",message:t.$t("user.login.message-invalid-credentials")}}):t._e(),e("a-form-item",[e("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["username",{rules:[{required:!0,message:t.$t("user.userName.required")},{validator:t.handleUsernameOrEmail}],validateTrigger:"change"}],expression:"[\n 'username',\n {rules: [{ required: true, message: $t('user.userName.required') }, { validator: handleUsernameOrEmail }], validateTrigger: 'change'}\n ]"}],attrs:{size:"large",type:"text",placeholder:"请输入用户名"}},[e("a-icon",{style:{color:"rgba(0,0,0,.25)"},attrs:{slot:"prefix",type:"user"},slot:"prefix"})],1)],1),e("a-form-item",[e("a-input-password",{directives:[{name:"decorator",rawName:"v-decorator",value:["password",{rules:[{required:!0,message:t.$t("user.password.required")}],validateTrigger:"blur"}],expression:"[\n 'password',\n {rules: [{ required: true, message: $t('user.password.required') }], validateTrigger: 'blur'}\n ]"}],attrs:{size:"large",placeholder:"请输入密码"}},[e("a-icon",{style:{color:"rgba(0,0,0,.25)"},attrs:{slot:"prefix",type:"lock"},slot:"prefix"})],1)],1),e("a-form-item",{staticStyle:{"margin-top":"24px"}},[e("a-button",{staticClass:"login-button",attrs:{size:"large",type:"primary",htmlType:"submit",loading:t.state.loginBtn,disabled:t.state.loginBtn}},[t._v(t._s(t.$t("user.login.login")))])],1)],1),t.requiredTwoStepCaptcha?e("two-step-captcha",{attrs:{visible:t.stepCaptchaVisible},on:{success:t.stepCaptchaSuccess,cancel:t.stepCaptchaCancel}}):t._e()],1)},i=[],o=n(76338),s=(n(26099),n(27495),n(83503)),a=n.n(s),u=function(){var t=this,e=this,n=e._self._c;return n("a-modal",{attrs:{centered:"",maskClosable:!1},on:{cancel:e.handleCancel},model:{value:e.visible,callback:function(t){e.visible=t},expression:"visible"}},[n("div",{style:{textAlign:"center"},attrs:{slot:"title"},slot:"title"},[e._v("两步验证")]),n("template",{slot:"footer"},[n("div",{style:{textAlign:"center"}},[n("a-button",{key:"back",on:{click:e.handleCancel}},[e._v("返回")]),n("a-button",{key:"submit",attrs:{type:"primary",loading:e.stepLoading},on:{click:e.handleStepOk}},[e._v(" 继续 ")])],1)]),n("a-spin",{attrs:{spinning:e.stepLoading}},[n("a-form",{attrs:{layout:"vertical","auto-form-create":function(e){t.form=e}}},[n("div",{staticClass:"step-form-wrapper"},[e.stepLoading?n("p",{staticStyle:{"text-align":"center"}},[e._v("正在验证.."),n("br"),e._v("请稍后")]):n("p",{staticStyle:{"text-align":"center"}},[e._v("请在手机中打开 Google Authenticator 或两步验证 APP"),n("br"),e._v("输入 6 位动态码")]),n("a-form-item",{style:{textAlign:"center"},attrs:{hasFeedback:"",fieldDecoratorId:"stepCode",fieldDecoratorOptions:{rules:[{required:!0,message:"请输入 6 位动态码!",pattern:/^\d{6}$/,len:6}]}}},[n("a-input",{style:{textAlign:"center"},attrs:{placeholder:"000000"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleStepOk.apply(null,arguments)}}})],1),n("p",{staticStyle:{"text-align":"center"}},[n("a",{on:{click:e.onForgeStepCode}},[e._v("遗失手机?")])])],1)])],1)],2)},c=[],l={props:{visible:{type:Boolean,default:!1}},data:function(){return{stepLoading:!1,form:null}},methods:{handleStepOk:function(){var t=this,e=this;this.stepLoading=!0,this.form.validateFields((function(n,r){n?(t.stepLoading=!1,t.$emit("error",{err:n})):setTimeout((function(){e.stepLoading=!1,e.$emit("success",{values:r})}),2e3)}))},handleCancel:function(){this.visible=!1,this.$emit("cancel")},onForgeStepCode:function(){}}},f=l,p=n(81656),d=(0,p.A)(f,u,c,!1,null,"4a462ef6",null),g=d.exports,h=n(95353),m=n(67569),v=n(505),y={components:{TwoStepCaptcha:g},data:function(){return{customActiveKey:"tab1",loginBtn:!1,loginType:0,isLoginError:!1,requiredTwoStepCaptcha:!1,stepCaptchaVisible:!1,form:this.$form.createForm(this),state:{time:60,loginBtn:!1,loginType:0,smsSendBtn:!1}}},created:function(){var t=this;(0,v.N)({}).then((function(e){t.requiredTwoStepCaptcha=e.result.stepCode})).catch((function(){t.requiredTwoStepCaptcha=!1}))},methods:(0,o.A)((0,o.A)({},(0,h.i0)(["Login","Logout"])),{},{handleUsernameOrEmail:function(t,e,n){var r=this.state,i=/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/;i.test(e)?r.loginType=0:r.loginType=1,n()},handleTabClick:function(t){this.customActiveKey=t},handleSubmit:function(t){var e=this;t.preventDefault();var n=this.form.validateFields,r=this.state,i=this.customActiveKey,s=this.Login;r.loginBtn=!0;var u="tab1"===i?["username","password"]:["mobile","captcha"];n(u,{force:!0},(function(t,n){if(t)setTimeout((function(){r.loginBtn=!1}),600);else{var i=(0,o.A)({},n);delete i.username,i[r.loginType?"user_name":"email"]=n.username,i.password=a()(n.password),i.password=n.password,s(i).then((function(t){return e.loginSuccess(t)})).catch((function(t){return e.requestFailed(t)})).finally((function(){r.loginBtn=!1}))}}))},getCaptcha:function(t){var e=this;t.preventDefault();var n=this.form.validateFields,r=this.state;n(["mobile"],{force:!0},(function(t,n){if(!t){r.smsSendBtn=!0;var i=window.setInterval((function(){r.time--<=0&&(r.time=60,r.smsSendBtn=!1,window.clearInterval(i))}),1e3),o=e.$message.loading("验证码发送中..",0);(0,v.mN)({mobile:n.mobile}).then((function(t){setTimeout(o,2500),e.$notification["success"]({message:"提示",description:"验证码获取成功,您的验证码为:"+t.result.captcha,duration:8})})).catch((function(t){setTimeout(o,1),clearInterval(i),r.time=60,r.smsSendBtn=!1,e.requestFailed(t)}))}}))},stepCaptchaSuccess:function(){this.loginSuccess()},stepCaptchaCancel:function(){var t=this;this.Logout().then((function(){t.loginBtn=!1,t.stepCaptchaVisible=!1}))},loginSuccess:function(t){var e=this;this.$router.push({path:"/"}),setTimeout((function(){e.$notification.success({message:"欢迎",description:"".concat((0,m.Z$)(),",欢迎回来")})}),1e3),this.isLoginError=!1},requestFailed:function(t){this.isLoginError=!0,this.$notification["error"]({message:"错误",description:((t.response||{}).data||{}).message||"请求出现错误,请稍后再试",duration:4})}})},b=y,T=(0,p.A)(b,r,i,!1,null,"5fd7d6ec",null),C=T.exports},83503:function(t,e,n){(function(){var e=n(3939),r=n(92151).utf8,i=n(87206),o=n(92151).bin,s=function(t,n){t.constructor==String?t=n&&"binary"===n.encoding?o.stringToBytes(t):r.stringToBytes(t):i(t)?t=Array.prototype.slice.call(t,0):Array.isArray(t)||t.constructor===Uint8Array||(t=t.toString());for(var a=e.bytesToWords(t),u=8*t.length,c=1732584193,l=-271733879,f=-1732584194,p=271733878,d=0;d<a.length;d++)a[d]=16711935&(a[d]<<8|a[d]>>>24)|4278255360&(a[d]<<24|a[d]>>>8);a[u>>>5]|=128<<u%32,a[14+(u+64>>>9<<4)]=u;var g=s._ff,h=s._gg,m=s._hh,v=s._ii;for(d=0;d<a.length;d+=16){var y=c,b=l,T=f,C=p;c=g(c,l,f,p,a[d+0],7,-680876936),p=g(p,c,l,f,a[d+1],12,-389564586),f=g(f,p,c,l,a[d+2],17,606105819),l=g(l,f,p,c,a[d+3],22,-1044525330),c=g(c,l,f,p,a[d+4],7,-176418897),p=g(p,c,l,f,a[d+5],12,1200080426),f=g(f,p,c,l,a[d+6],17,-1473231341),l=g(l,f,p,c,a[d+7],22,-45705983),c=g(c,l,f,p,a[d+8],7,1770035416),p=g(p,c,l,f,a[d+9],12,-1958414417),f=g(f,p,c,l,a[d+10],17,-42063),l=g(l,f,p,c,a[d+11],22,-1990404162),c=g(c,l,f,p,a[d+12],7,1804603682),p=g(p,c,l,f,a[d+13],12,-40341101),f=g(f,p,c,l,a[d+14],17,-1502002290),l=g(l,f,p,c,a[d+15],22,1236535329),c=h(c,l,f,p,a[d+1],5,-165796510),p=h(p,c,l,f,a[d+6],9,-1069501632),f=h(f,p,c,l,a[d+11],14,643717713),l=h(l,f,p,c,a[d+0],20,-373897302),c=h(c,l,f,p,a[d+5],5,-701558691),p=h(p,c,l,f,a[d+10],9,38016083),f=h(f,p,c,l,a[d+15],14,-660478335),l=h(l,f,p,c,a[d+4],20,-405537848),c=h(c,l,f,p,a[d+9],5,568446438),p=h(p,c,l,f,a[d+14],9,-1019803690),f=h(f,p,c,l,a[d+3],14,-187363961),l=h(l,f,p,c,a[d+8],20,1163531501),c=h(c,l,f,p,a[d+13],5,-1444681467),p=h(p,c,l,f,a[d+2],9,-51403784),f=h(f,p,c,l,a[d+7],14,1735328473),l=h(l,f,p,c,a[d+12],20,-1926607734),c=m(c,l,f,p,a[d+5],4,-378558),p=m(p,c,l,f,a[d+8],11,-2022574463),f=m(f,p,c,l,a[d+11],16,1839030562),l=m(l,f,p,c,a[d+14],23,-35309556),c=m(c,l,f,p,a[d+1],4,-1530992060),p=m(p,c,l,f,a[d+4],11,1272893353),f=m(f,p,c,l,a[d+7],16,-155497632),l=m(l,f,p,c,a[d+10],23,-1094730640),c=m(c,l,f,p,a[d+13],4,681279174),p=m(p,c,l,f,a[d+0],11,-358537222),f=m(f,p,c,l,a[d+3],16,-722521979),l=m(l,f,p,c,a[d+6],23,76029189),c=m(c,l,f,p,a[d+9],4,-640364487),p=m(p,c,l,f,a[d+12],11,-421815835),f=m(f,p,c,l,a[d+15],16,530742520),l=m(l,f,p,c,a[d+2],23,-995338651),c=v(c,l,f,p,a[d+0],6,-198630844),p=v(p,c,l,f,a[d+7],10,1126891415),f=v(f,p,c,l,a[d+14],15,-1416354905),l=v(l,f,p,c,a[d+5],21,-57434055),c=v(c,l,f,p,a[d+12],6,1700485571),p=v(p,c,l,f,a[d+3],10,-1894986606),f=v(f,p,c,l,a[d+10],15,-1051523),l=v(l,f,p,c,a[d+1],21,-2054922799),c=v(c,l,f,p,a[d+8],6,1873313359),p=v(p,c,l,f,a[d+15],10,-30611744),f=v(f,p,c,l,a[d+6],15,-1560198380),l=v(l,f,p,c,a[d+13],21,1309151649),c=v(c,l,f,p,a[d+4],6,-145523070),p=v(p,c,l,f,a[d+11],10,-1120210379),f=v(f,p,c,l,a[d+2],15,718787259),l=v(l,f,p,c,a[d+9],21,-343485551),c=c+y>>>0,l=l+b>>>0,f=f+T>>>0,p=p+C>>>0}return e.endian([c,l,f,p])};s._ff=function(t,e,n,r,i,o,s){var a=t+(e&n|~e&r)+(i>>>0)+s;return(a<<o|a>>>32-o)+e},s._gg=function(t,e,n,r,i,o,s){var a=t+(e&r|n&~r)+(i>>>0)+s;return(a<<o|a>>>32-o)+e},s._hh=function(t,e,n,r,i,o,s){var a=t+(e^n^r)+(i>>>0)+s;return(a<<o|a>>>32-o)+e},s._ii=function(t,e,n,r,i,o,s){var a=t+(n^(e|~r))+(i>>>0)+s;return(a<<o|a>>>32-o)+e},s._blocksize=16,s._digestsize=16,t.exports=function(t,n){if(void 0===t||null===t)throw new Error("Illegal argument "+t);var r=e.wordsToBytes(s(t,n));return n&&n.asBytes?r:n&&n.asString?o.bytesToString(r):e.bytesToHex(r)}})()},87206:function(t){function e(t){return!!t.constructor&&"function"===typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}function n(t){return"function"===typeof t.readFloatLE&&"function"===typeof t.slice&&e(t.slice(0,0))}
- /*!
- * Determine if an object is a Buffer
- *
- * @author Feross Aboukhadijeh <https://feross.org>
- * @license MIT
- */
- t.exports=function(t){return null!=t&&(e(t)||n(t)||!!t._isBuffer)}},92151:function(t){var e={utf8:{stringToBytes:function(t){return e.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(e.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],n=0;n<t.length;n++)e.push(255&t.charCodeAt(n));return e},bytesToString:function(t){for(var e=[],n=0;n<t.length;n++)e.push(String.fromCharCode(t[n]));return e.join("")}}};t.exports=e}}]);
|