1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5fed03cf"],{"531f":function(e,t,i){"use strict";var n=i("9c15"),o=i("8655"),r=i("2c48"),a=i("81c6"),c=i("1b4d"),s=i("059d"),l=i("d7ab"),d=i("5311"),u=i("6326"),h=i("462a"),g=i("ae28"),f=i("d006"),m=g("isConcatSpreadable"),p=9007199254740991,w="Maximum allowed index exceeded",b=o.TypeError,x=f>=51||!r((function(){var e=[];return e[m]=!1,e.concat()[0]!==e})),v=h("concat"),y=function(e){if(!c(e))return!1;var t=e[m];return void 0!==t?!!t:a(e)},_=!x||!v;n({target:"Array",proto:!0,forced:_},{concat:function(e){var t,i,n,o,r,a=s(this),c=u(a,0),h=0;for(t=-1,n=arguments.length;t<n;t++)if(r=-1===t?a:arguments[t],y(r)){if(o=l(r),h+o>p)throw b(w);for(i=0;i<o;i++,h++)i in r&&d(c,h,r[i])}else{if(h>=p)throw b(w);d(c,h++,r)}return c.length=h,c}})},"79ba":function(e,t,i){"use strict";i.r(t);var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"pt-28 p-4"},[i("div",{staticClass:"text-center"},[i("van-image",{attrs:{width:"6rem",height:"6rem",src:this.$settings.logo}}),i("p",{staticClass:"mt-5 mb-12 text-2xl"},[e._v("志远派单平台")])],1),e.showLoginType?i("div",{staticClass:"text-center"},[i("van-button",{attrs:{type:"primary",size:"large",round:"",block:"","icon-prefix":"my-icon",icon:"weixin"},on:{click:e.weixinLogin}},[e._v("微信授权登录")]),i("p",{staticClass:"mt-4 text-gray-400 text-sm",staticStyle:{"font-size":"1rem","line-height":"2rem"},on:{click:e.mimaLogin}},[e._v(" 账号密码登录 ")])],1):e._e(),e.showLoginType?e._e():i("van-form",{on:{submit:e.onSubmit}},[i("van-field",{attrs:{clearable:"",label:"手机号",placeholder:"请输入手机号",type:"tel",rules:[{required:!0}]},model:{value:e.loginForm.phone,callback:function(t){e.$set(e.loginForm,"phone",t)},expression:"loginForm.phone"}}),i("van-field",{attrs:{type:"password",name:"密码",label:"密码",placeholder:"密码",rules:[{required:!0,message:"请填写密码"}]},model:{value:e.loginForm.password,callback:function(t){e.$set(e.loginForm,"password",t)},expression:"loginForm.password"}}),i("div",{staticClass:"mt-8"},[i("van-button",{attrs:{loading:e.loginLoading,disabled:e.disabled,block:"",type:"info","loading-text":"加载中...","native-type":"submit"}},[e._v(e._s(e.btnText))])],1),2==e.loginForm.login_type?i("div",[i("van-divider",{style:{borderColor:"#4B5563",paddingTop:"20px"},attrs:{"content-position":"center"}},[e._v("其它登录方式")]),i("van-icon",{staticClass:"w-full text-center inline-block",attrs:{"class-prefix":"my-icon",name:"weixin",color:"#07c160",size:"2.5rem"},on:{click:e.weixinLogin}})],1):e._e()],1)],1)},o=[],r=(i("d64c"),i("3714"),i("27d3"),i("a692"),i("a405"),i("4d38"),i("4bce"),i("f8c2"),i("509f"),i("531f"),i("f0e1")),a=i("7be5");function c(e,t){return Object(r["a"])({url:a["a"].weixin+"oauth_url/".concat(e),method:"get",params:t})}function s(e,t){return Object(r["a"])({url:a["a"].weixin+"admin_info/".concat(e,"?code=").concat(t),method:"get"})}var l="Dispatch-Storage",d={get:function(e){var t=window.localStorage.getItem(l+"_"+e);return t?window.JSON.parse(t):""},set:function(e,t){window.localStorage.setItem(l+"_"+e,window.JSON.stringify(t))},del:function(e,t){window.localStorage.removeItem(l+"_"+e)}},u=i("367a"),h=(i("eaf8"),{data:function(){return{btnText:"登录",disabled:!1,wxID:1,code:"",loginLoading:!1,showLoginType:!0,countDownTime:6e4,loginForm:{phone:"",code:"",openid:"",nickname:"",sex:0,headimgurl:"",login_type:1}}},watch:{$route:{handler:function(e){var t=e.query;console.log(e.query),t&&(this.redirect=t.redirect,this.otherQuery=this.getOtherQuery(t))},immediate:!0}},created:function(){var e=this.getUrlKey("code");if(null!=e&&""!==e)return d.set("weixin_code",e),void(window.location.href=d.get("href"));this.code=d.get("weixin_code"),1===this.loginForm.login_type&&null!=this.code&&""!==this.code?this.fetchUserInfo():this.btnText="登录"},mounted:function(){d.set("href",window.location.href)},methods:{weixinLogin:function(){this.loginForm.login_type=1,c(this.wxID,{scope:"snsapi_userinfo",url:"dispatch#/login"}).then((function(e){window.location.href=e.data}))},mimaLogin:function(){this.loginForm.login_type=2,this.showLoginType=!1},fetchUserInfo:function(){var e=this;this.disabled=!0,s(this.wxID,this.code).then((function(t){if(d.del("weixin_code"),e.loginForm.openid=t.data.openid,e.loginForm.nickname=t.data.nickname,e.loginForm.sex=t.data.sex,e.loginForm.headimgurl=t.data.headimgurl,t.data.is_exists)return e.onSubmit();e.showLoginType=!1,e.btnText="绑定微信并登录",e.disabled=!1})).catch((function(){d.del("weixin_code")}))},onSubmit:function(){var e=this;this.loginLoading=!0,u["a"],this.$store.dispatch("user/login",this.loginForm).then((function(){e.$router.push({path:e.redirect||"/home",query:e.otherQuery}),e.loginLoading=!1})).catch((function(){e.loginLoading=!1}))},getUrlKey:function(e){return decodeURIComponent((new RegExp("[?|&]"+e+"=([^&;]+?)(&|#|;|$)").exec(location.href)||[,""])[1].replace(/\+/g,"%20"))||null},getOtherQuery:function(e){return Object.keys(e).reduce((function(t,i){return"redirect"!==i&&(t[i]=e[i]),t}),{})}}}),g=h,f=i("cba8"),m=Object(f["a"])(g,n,o,!1,null,null,null);t["default"]=m.exports},"7be5":function(e,t,i){"use strict";var n=i("7139");t["a"]={customer:n["a"].baseApi+"api/aftersale/customer/",work:n["a"].baseApi+"worker/",weixin:n["a"].baseUrl+"api/weixin/"}}}]);
|