chunk-b498323c.ac501d66.js 8.6 KB

1
  1. (window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-b498323c"],{"1a20":function(e,t,o){},"43b9":function(e,t,o){"use strict";o.r(t);var i=o("61f7"),s=o("bf2a"),r=o("6a1e"),a=o("9f53");a={name:"Login",components:{SocialSign:s.a},mixins:[a.a],data(){return{stepList:["验证身份","重设密码","设置成功"],timer:null,num:3,step:0,loginFormX:{username:"",mobile:"",code:""},loginRulesX:{username:[{required:!0,trigger:"blur",validator:(e,t,o)=>{""===t?o(new Error("请输入账号")):o()}}],mobile:[{required:!0,trigger:"blur",validator:(e,t,o)=>{""===t?o(new Error("手机号不能为空!")):Object(i.g)(t)?o():o(new Error("手机号不正确!"))}}],code:[{required:!0,trigger:"blur",validator:(e,t,o)=>{""===t?o(new Error("验证码不能为空!")):Object(i.i)(t)&&6===t.length?o():o(new Error("验证码应为6位数字!"))}}]},loginFormY:{newPassword:"",confirmPassword:""},loginRulesY:{newPassword:[{required:!0,trigger:"blur",validator:(e,t,o)=>{""===t?o(new Error("新密码不能为空!")):!Object(i.b)(t)||t.length<6||16<t.length?o(new Error("新密码为6-16位数字字母组合!")):Object(i.i)(t)?o(new Error("新密码不能为纯数字!")):Object(i.k)(t)?o(new Error("新密码不能为纯字母!")):o()}}],confirmPassword:[{required:!0,trigger:"blur",validator:(e,t,o)=>{""===t?o(new Error("确认密码不能为空!")):this.loginFormY.newPassword!==t?o(new Error("确认密码与新密码不一致!")):o()}}]},codeType:"code",capsTooltip:!1,loading:!1,showDialog:!1,redirect:void 0,otherQuery:{}}},created(){},mounted(){""===this.loginFormX.mobile&&this.$refs.mobile.focus(),""===this.loginFormX.code&&this.$refs.code.focus()},destroyed(){},methods:{modifyPostLevel(e){this.step=e},phoneErr(e){e||this.$refs.loginFormX.validateField("mobile")},checkCapslock(e){var{key:e}=e;this.capsTooltip=e&&1===e.length&&"A"<=e&&e<="Z"},handleLoginX(){this.$refs.loginFormX.validate(e=>!!e&&void this.step++)},handleLoginY(){this.$refs.loginFormY.validate(e=>!!e&&void(this.loading||(this.loading=!0,e={username:this.loginFormX.username,mobile:this.loginFormX.mobile,code:this.loginFormX.code,password:this.loginFormY.newPassword},r.a.resetpwd(e).then(async e=>{e&&0===e.code?(this.loading=!1,this.step++,this.setTime()):e&&100<=e.code&&e.code<=104?await this.logout():(this.$message.warning(e.message),this.loading=!1)}))))},setTime(){this.timer=setInterval(()=>{0!==this.num?this.num--:this.timer&&(clearInterval(this.timer),this.num=3,this.gotoLogin())},1e3)},gotoLogin(){window.vm.$router.replace("/login")}}},o("ebdd"),o("672e"),o=o("2877"),a=Object(o.a)(a,(function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"forget-password"},[o("div",{staticClass:"forget-main"},[o("div",{staticClass:"my-card"},[e._m(0),o("div",{staticStyle:{margin:"8px 0 35px 0"}},[o("el-steps",{attrs:{active:e.step,simple:"","process-status":"finish","finish-status":"success"}},e._l(e.stepList,(function(e,t){return o("el-step",{key:t,attrs:{title:e}})})),1)],1),0===e.step?o("div",[o("el-form",{ref:"loginFormX",staticClass:"login-form",attrs:{model:e.loginFormX,rules:e.loginRulesX,autocomplete:"on","label-position":"left","label-width":"95px"}},[o("el-form-item",{attrs:{prop:"username",label:"账号:"}},[o("el-input",{ref:"username",attrs:{placeholder:"账号",name:"username",type:"text",tabindex:"1",autocomplete:"on"},model:{value:e.loginFormX.username,callback:function(t){e.$set(e.loginFormX,"username",t)},expression:"loginFormX.username"}})],1),o("el-form-item",{attrs:{prop:"mobile",label:"手机号:"}},[o("el-input",{ref:"mobile",attrs:{placeholder:"手机号",name:"mobile",type:"text",tabindex:"1",autocomplete:"on"},model:{value:e.loginFormX.mobile,callback:function(t){e.$set(e.loginFormX,"mobile",t)},expression:"loginFormX.mobile"}})],1),o("el-form-item",{staticClass:"code-sign",attrs:{prop:"code",label:"验证码:"}},[o("ul",{staticClass:"code-main"},[o("li",[o("el-input",{ref:"code",attrs:{placeholder:"验证码",name:"code",type:"text",tabindex:"1",autocomplete:"on"},model:{value:e.loginFormX.code,callback:function(t){e.$set(e.loginFormX,"code",t)},expression:"loginFormX.code"}})],1),o("li",[o("SocialSign",{attrs:{mobile:e.loginFormX.mobile},on:{phoneErr:e.phoneErr}})],1)])]),o("el-button",{staticStyle:{width:"100%","margin-top":"10px"},attrs:{type:"primary"},nativeOn:{click:function(t){return t.preventDefault(),e.handleLoginX(t)}}},[e._v("下一步")])],1)],1):1===e.step?o("div",[o("el-form",{ref:"loginFormY",staticClass:"login-form",attrs:{model:e.loginFormY,rules:e.loginRulesY,autocomplete:"on","label-position":"left","label-width":"100px"}},[o("el-form-item",{attrs:{prop:"newPassword",label:"新密码:"}},[o("el-input",{ref:"newPassword",attrs:{placeholder:"6-16位数字字母组合",name:"newPassword",type:"password",tabindex:"1",autocomplete:"on"},model:{value:e.loginFormY.newPassword,callback:function(t){e.$set(e.loginFormY,"newPassword",t)},expression:"loginFormY.newPassword"}})],1),o("el-form-item",{attrs:{prop:"confirmPassword",label:"确认密码:"}},[o("el-input",{ref:"confirmPassword",attrs:{placeholder:"6-16位数字字母组合",name:"confirmPassword",type:"password",tabindex:"1",autocomplete:"on"},model:{value:e.loginFormY.confirmPassword,callback:function(t){e.$set(e.loginFormY,"confirmPassword",t)},expression:"loginFormY.confirmPassword"}})],1),o("el-button-group",{staticStyle:{"margin-top":"10px"}},[o("el-button",{staticStyle:{width:"140px"},attrs:{type:"primary",disabled:e.loading,icon:"el-icon-arrow-left"},nativeOn:{click:function(t){t.preventDefault(),e.step=0}}},[e._v("上一步")]),o("el-button",{staticStyle:{width:"140px"},attrs:{type:"primary",loading:e.loading},nativeOn:{click:function(t){return t.preventDefault(),e.handleLoginY(t)}}},[e._v("下一步"),o("i",{staticClass:"el-icon-arrow-right el-icon--right"})])],1)],1)],1):o("div",{staticClass:"success-card"},[e._m(1),o("div",{staticClass:"teps-title"},[e._v("恭喜你,新密码设置成功!")]),o("div",{staticClass:"teps-time"},[o("span",[e._v(e._s(e.num))]),e._v("秒后自动返回 ")])])])])])}),[function(){var e=this,t=e.$createElement;t=e._self._c||t;return t("div",{staticClass:"title-container"},[t("h3",{staticClass:"title"},[e._v("设置新登录密码")])])},function(){var e=this.$createElement;e=this._self._c||e;return e("div",{staticClass:"success-icon"},[e("i",{staticClass:"el-icon-success"})])}],!1,null,"bc4a2840",null);t.default=a.exports},"672e":function(e,t,o){"use strict";o("a33e")},"6a1e":function(e,t,o){"use strict";o("a18c");var i=o("5daa"),s=o("5f87");const r={};window.ajaxTimeout=2e4;var a=async(e="",t={},o="GET",a={},n=r,l)=>{const c={method:o=o.toLowerCase(),baseURL:"",url:i.a.userURL+e,data:t,params:a,processData:!0,timeout:window.ajaxTimeout,headers:n,onUploadProgress:l};return l&&"function"==typeof l&&(c.onUploadProgress=l),axios.interceptors.request.use(e=>(e.data.token||(e.data.token=Object(s.e)()),e),e=>Promise.reject(new Error("服务器异常,请联系管理员!"))),axios.interceptors.response.use(async e=>{var t;return 200!==e.status||100<=(t=e.data.code)&&t<=104&&(Object(s.i)(),Object(s.h)(),Object(s.f)()),e},e=>Promise.reject(e.response.data)),new Promise((e,t)=>{axios(c).then(t=>{e(t.data)}).catch(e=>{e.response&&e.response.data?t(e.response.data):t(e)})})};t.a={verfiy:(e,t)=>a("admin/verify_code",e,"post",t),resetpwd:(e,t)=>a("admin/passmobile",e,"post",t),resetmobile:(e,t)=>a("admin/resetmobile",e,"post",t),setpwd:(e,t)=>a("admin/passsave",e,"post",t),list:(e,t)=>a("admin/menu",e,"post",t),detail:(e,t)=>a("admin/userinfo",e,"post",t),version:(e,t)=>a("admin/lastversion",e,"post",t),prefect:(e,t)=>a("admin/prefect",e,"post",t)}},a244:function(e,t,o){},a33e:function(e,t,o){},bf2a:function(e,t,o){"use strict";var i=o("61f7"),s=o("6a1e"),r=o("9f53");r={props:{mobile:{type:String,default:""}},mixins:[r.a],data(){return{num:60,title:"获取验证码",timer:null}},computed:{},methods:{getCode(){""!==this.mobile&&Object(i.g)(this.mobile)?60===this.num&&s.a.verfiy({mobile:this.mobile}).then(async e=>{e&&0===e.code?this.timer=setInterval(()=>{0!==this.num?(this.title=this.num+"s后可重发",this.num--):(clearInterval(this.timer),this.num=60,this.title="获取验证码")},1e3):e&&100<=e.code&&e.code<=104?await this.logout():this.$message.warning(e.message)}):this.$emit("mobileErr",!1)}}},o("f36d"),o=o("2877"),r=Object(o.a)(r,(function(){var e=this,t=e.$createElement;return(e._self._c||t)("el-button",{staticClass:"send-verification-code",attrs:{type:e.num<60?"info":"primary",plain:e.num<60,disabled:e.num<60},on:{click:e.getCode}},[e._v(e._s(e.title))])}),[],!1,null,"a4e6982a",null);t.a=r.exports},ebdd:function(e,t,o){"use strict";o("1a20")},f36d:function(e,t,o){"use strict";o("a244")}}]);