!function(){function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}var e=["returnUrl","isRegister"];function n(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function r(t){for(var e=1;e=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function i(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */i=function(){return e};var e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(P){s=function(t,e,n){return t[e]=n}}function f(t,e,n,r){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype),u=new L(r||[]);return o(a,"_invoke",{value:x(t,n,u)}),a}function d(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(P){return{type:"throw",arg:P}}}e.wrap=f;var p={};function h(){}function g(){}function m(){}var v={};s(v,u,(function(){return this}));var y=Object.getPrototypeOf,_=y&&y(y(j([])));_&&_!==n&&r.call(_,u)&&(v=_);var b=m.prototype=h.prototype=Object.create(v);function w(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function S(e,n){function i(o,a,u,c){var l=d(e[o],e,a);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==t(f)&&r.call(f,"__await")?n.resolve(f.__await).then((function(t){i("next",t,u,c)}),(function(t){i("throw",t,u,c)})):n.resolve(f).then((function(t){s.value=t,u(s)}),(function(t){return i("throw",t,u,c)}))}c(l.arg)}var a;o(this,"_invoke",{value:function(t,e){function r(){return new n((function(n,r){i(t,e,n,r)}))}return a=a?a.then(r,r):r()}})}function x(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return E()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var u=k(a,n);if(u){if(u===p)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=d(t,e,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===p)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}function k(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,k(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;var o=d(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,p;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,p):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function j(t){if(t){var e=t[u];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(u&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),O(n),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;O(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:j(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},e}function a(t,e,n,r,o,i,a){try{var u=t[i](a),c=u.value}catch(l){return void n(l)}u.done?e(c):Promise.resolve(c).then(r,o)}function u(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function u(t){a(i,r,o,u,c,"next",t)}function c(t){a(i,r,o,u,c,"throw",t)}u(void 0)}))}}function c(e,n,r){return(n=function(e){var n=function(e,n){if("object"!==t(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,n||"default");if("object"!==t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"===t(n)?n:String(n)}(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function l(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,u=[],c=!0,l=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(u.push(r.value),u.length!==e);c=!0);}catch(s){l=!0,o=s}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return s(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n24?(t.push([r]),e-=24):t[t.length-1].push(r)})),t}));return i({spaces:p((function(){var e=Number(t.gutter),n=[];return e?(a.value.forEach((function(t){var r=e*(t.length-1)/t.length;t.forEach((function(t,o){if(0===o)n.push({right:r});else{var i=e-n[t-1].right,a=r-i;n.push({left:i,right:a})}}))})),n):n}))}),function(){var e,r=t.tag,o=t.wrap,i=t.align,a=t.justify;return w(r,{class:lt((e={},c(e,"align-".concat(i),i),c(e,"justify-".concat(a),a),c(e,"nowrap",!o),e))},{default:function(){var t;return[null==(t=n.default)?void 0:t.call(n)]}})}}}),pt=l(a("col"),2),ht=pt[0],gt=pt[1],mt={tag:k("div"),span:D(0),offset:S},vt=s({name:ht,props:mt,setup:function(t,e){var n=e.slots,r=q(st),o=r.parent,i=r.index,a=p((function(){if(o){var t=o.spaces;if(t&&t.value&&t.value[i.value]){var e=t.value[i.value],n=e.left,r=e.right;return{paddingLeft:n?"".concat(n,"px"):null,paddingRight:r?"".concat(r,"px"):null}}}}));return function(){var e,r=t.tag,o=t.span,i=t.offset;return w(r,{style:a.value,class:gt((e={},c(e,o,o),c(e,"offset-".concat(i),i),e))},{default:function(){var t;return[null==(t=n.default)?void 0:t.call(n)]}})}}}),yt=E(vt);var _t=l(a("count-down"),2),bt=_t[0],wt=_t[1],St={time:D(0),format:k("HH:mm:ss"),autoStart:x,millisecond:Boolean},xt=s({name:bt,props:St,emits:["change","finish"],setup:function(t,e){var n=e.emit,r=e.slots,o=z({time:+t.time,millisecond:t.millisecond,onChange:function(t){return n("change",t)},onFinish:function(){return n("finish")}}),i=o.start,a=o.pause,u=o.reset,c=o.current,l=p((function(){return function(t,e){var n=e.days,r=e.hours,o=e.minutes,i=e.seconds,a=e.milliseconds;if(t.includes("DD")?t=t.replace("DD",N(n)):r+=24*n,t.includes("HH")?t=t.replace("HH",N(r)):o+=60*r,t.includes("mm")?t=t.replace("mm",N(o)):i+=60*o,t.includes("ss")?t=t.replace("ss",N(i)):a+=1e3*i,t.includes("S")){var u=N(a,3);t=t.includes("SSS")?t.replace("SSS",u):t.includes("SS")?t.replace("SS",u.slice(0,2)):t.replace("S",u.charAt(0))}return t}(t.format,c.value)})),s=function(){u(+t.time),t.autoStart&&i()};return m((function(){return t.time}),s,{immediate:!0}),$({start:i,pause:a,reset:s}),function(){return w("div",{role:"timer",class:wt()},[r.default?r.default(c.value):l.value])}}}),kt=E(xt),Ct=E(dt),Ot="_imgCode_mq980_1",Lt="_codeTitle_mq980_4",jt="_img_mq980_1",Et="_imgChange_mq980_16",Pt="_field_mq980_23",Tt="_imgCodePopup_mq980_27",Dt=s({name:"o-img-code",props:{value:Boolean,phone:[String,Number],type:{type:String,default:"LOGIN"}},emits:["close","sendCode"],data:function(){return{isSuffix:"/api-web",showStatus:!1,identifyingCode:window.location.origin+"/api-web/code/getLoginImage?phone="+this.phone,code:""}},mounted:function(){this.showStatus=this.value},watch:{value:function(t){this.showStatus=t},code:function(t){t.length>=4&&this.checkVerifyLoginImage()}},methods:{updateIdentifyingCode:function(){var t=this;return u(i().mark((function e(){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=window.location.origin,t.identifyingCode="".concat(n,"/api-web/code/getLoginImage?phone=").concat(t.phone,"&token=").concat(Math.random());case 2:case"end":return e.stop()}}),e)})))()},checkVerifyLoginImage:function(){var t=this;return u(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!(t.code.length<4)){e.next=3;break}return e.abrupt("return");case 3:return e.next=5,A.post("".concat(t.isSuffix,"/code/verifyLoginImage"),{requestType:"form",hideLoading:!0,data:{phone:t.phone,code:t.code}});case 5:return e.next=7,A.post("".concat(t.isSuffix,"/code/sendSms"),{requestType:"form",hideLoading:!0,data:{mobile:t.phone}});case 7:setTimeout((function(){F("验证码已发送")}),100),t.$emit("close"),t.$emit("sendCode"),e.next=16;break;case 12:e.prev=12,e.t0=e.catch(0),t.code="",t.updateIdentifyingCode();case 16:case"end":return e.stop()}}),e,null,[[0,12]])})))()}},render:function(){var t=this;return w(U,{show:this.showStatus,class:Tt,closeOnClickOverlay:!1,onClose:function(){t.$emit("close")},closeable:!0,closeIcon:"close"},{default:function(){return[w("div",{class:Ot},[w("p",{class:Lt},[G("输入图形验证码")]),w(Ct,null,{default:function(){return[w(yt,{span:"14"},{default:function(){return[w(J,{placeholder:"请输入验证码",modelValue:t.code,"onUpdate:modelValue":function(e){return t.code=e},class:Pt},null)]}}),w(yt,{span:"10",class:jt},{default:function(){return[w(tt,{src:t.identifyingCode,onClick:function(){return t.updateIdentifyingCode()}},{loading:function(){return w(V,{type:"spinner",size:"20"},null)}})]}})]}}),w(Ct,{style:{display:"flex",justifyContent:"end"}},{default:function(){return[w(yt,{span:"10"},{default:function(){return[w("span",{class:Et,onClick:function(){return t.updateIdentifyingCode()}},[G("看不清?换一换")])]}})]}})])]}})}}),It={login:"_login_pvck2_1",codeText:"_codeText_pvck2_6",logo:"_logo_pvck2_9",container:"_container_pvck2_21","input-group":"_input-group_pvck2_24","code-text":"_code-text_pvck2_45","login-change":"_login-change_pvck2_62"};t("default",s({name:"layout-login",data:function(){return{loginType:"SMS",username:"",password:"",smsCode:"",countDownStatus:!0,countDownTime:12e4,imgCodeStatus:!1}},computed:{codeDisable:function(){var t=!0;return"PWD"===this.loginType?this.username&&this.password&&(t=!1):this.username&&this.smsCode&&(t=!1),t}},mounted:function(){R(),this.directNext()},methods:{directNext:function(){if("login"===B.user.status||"error"===B.user.status){var t=this.$route.query,n=t.returnUrl,i=(t.isRegister,o(t,e));this.$router.replace({path:n,query:r({},i)})}},onLogin:function(){var t=this;return u(i().mark((function e(){var n,o,a,u,c,l;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,n={phone:t.username,clientId:"EDUCATION",clientSecret:"EDUCATION"},"PWD"!==t.loginType){e.next=12;break}return n.password=t.password,n.grant_type="password",e.next=7,A.post("/api-auth/usernameLogin",{requestType:"form",data:r({},n)});case 7:o=e.sent,a=o.data,H(a.authentication.token_type+" "+a.authentication.access_token),e.next=18;break;case 12:return n.smsCode=t.smsCode,e.next=15,A.post("/api-auth/smsLogin",{requestType:"form",data:r({},n)});case 15:u=e.sent,c=u.data,H(c.authentication.token_type+" "+c.authentication.access_token);case 18:return e.next=20,A.get("/api-web/schoolStaff/queryUserInfo",{initRequest:!0});case 20:l=e.sent,M(l.data),t.directNext(),e.next=27;break;case 25:e.prev=25,e.t0=e.catch(0);case 27:case"end":return e.stop()}}),e,null,[[0,25]])})))()},onSendCode:function(){var t=this;return u(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(W(t.username)){e.next=2;break}return e.abrupt("return",F("请输入正确的手机号码"));case 2:t.imgCodeStatus=!0;case 3:case"end":return e.stop()}}),e)})))()},onCodeSend:function(){var t=this;this.countDownStatus=!1,this.$nextTick((function(){t.$refs.countDownRef.start()}))},onFinished:function(){this.countDownStatus=!0,this.$refs.countDownRef.reset()},onChange:function(){"PWD"===this.loginType?this.loginType="SMS":"SMS"===this.loginType&&(this.loginType="PWD")}},render:function(){var t=this;return w("div",{class:[It.login]},[w("div",{class:It.logo},null),w(at,{class:It.container,border:!1},{default:function(){return[w(J,{modelValue:t.username,"onUpdate:modelValue":function(e){return t.username=e},name:"手机号",placeholder:"请输入您的手机号",type:"tel",class:It["input-group"],maxlength:11},null),"PWD"===t.loginType?w(J,{modelValue:t.password,"onUpdate:modelValue":function(e){return t.password=e},type:"password",name:"密码",class:It["input-group"],placeholder:"请输入密码"},null):w(J,{modelValue:t.smsCode,"onUpdate:modelValue":function(e){return t.smsCode=e},name:"验证码",placeholder:"请输入验证码",type:"tel",class:It["input-group"],maxlength:6},{button:function(){return t.countDownStatus?w("span",{class:It.codeText,onClick:t.onSendCode},[G("获取验证码")]):w(kt,{ref:"countDownRef","auto-start":!1,time:t.countDownTime,onFinish:t.onFinished,format:"ss秒"},null)}})]}}),w("div",{class:It.margin34},[w(Y,{round:!0,block:!0,disabled:this.codeDisable,onClick:this.onLogin},{default:function(){return[G("提交")]}}),w("span",{class:It["login-change"],onClick:this.onChange},["PWD"===this.loginType?"验证码登录":"密码登录"])]),this.imgCodeStatus?w(Dt,{value:this.imgCodeStatus,"onUpdate:value":function(e){return t.imgCodeStatus=e},phone:this.username,onClose:function(){t.imgCodeStatus=!1},onSendCode:this.onCodeSend},null):null])}}))}}}))}();