hotime/example/tpt/js/chunk-6feafdad.545f8201.js
2022-02-28 09:59:05 +08:00

1 line
4.1 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-6feafdad"],{1:function(t,e){},2934:function(t,e,n){"use strict";n.d(e,"e",function(){return r}),n.d(e,"d",function(){return i}),n.d(e,"b",function(){return s}),n.d(e,"c",function(){return c}),n.d(e,"a",function(){return u}),n.d(e,"f",function(){return d}),n.d(e,"g",function(){return l});var e=n("b0c0"),a=n("b775"),e=n("4328"),o=n.n(e);function r(t,e){return Object(a.b)({url:t,method:"GET",params:e})}function i(t,e){return Object(a.b)({url:t,method:"GET",params:e})}function s(t,e){return Object(a.b)({url:t,method:"DELETE",data:o.a.stringify(e)})}function c(t,e){return Object(a.b)({url:t,method:"PUT",data:o.a.stringify(e)})}function u(t,e){return Object(a.b)({url:t,method:"POST",data:o.a.stringify(e)})}function d(t){var e=new FormData;return e.append("file",t,t.name),Object(a.b)({url:"file",headers:{"Content-Type":"multipart/form-data"},method:"POST",data:e})}function l(n,o){var r=document.createElement("input");r.type="file";r.addEventListener("change",function(){var t,e=r.files[0];0!==e.size?((t=new FormData).append("file",e,e.name),t.append("org_id",n.org_id),Object(a.b)({url:"admin/company_inout/upload",headers:{"Content-Type":"multipart/form-data"},method:"POST",data:t}).then(o)):o(null,"文件错误",r)}),r.click()}},"40a7":function(t,e,n){},"578a":function(t,e,n){"use strict";n.r(e);n("b0c0");var i=n("9f9f");Object(i.O)("data-v-581864d3");var s={class:"login",style:{width:"100%",height:"100vh"}},c={class:"login-item"},u={class:"left-title"},d={class:"right-content"},l=Object(i.o)("p",{class:"login-title"},"登录",-1),f={style:{height:"40px"}},p={class:"inputWrap"},b=Object(i.r)(" 账号:"),m={class:"inputWrap"},h=Object(i.r)(" 密码:");Object(i.M)();var o=n("2934"),r={name:"Login",data:function(){return{showLog:!1,showLogInfo:"",label:"HoTime DashBoard",form:{name:"",password:""}}},methods:{login:function(){var e=this;if(""==this.name||""==this.password)return this.showLogInfo="参数不足!",void(this.showLog=!0);Object(o.a)(window.Hotime.data.name+"/hotime/login",e.form).then(function(t){return 0!=t.status?(e.showLogInfo=t.error.msg,void(e.showLog=!0)):void e.$router.push({path:"/"})})}},mounted:function(){this.label=window.Hotime.data.label}};n("8d39");r.render=function(t,e,n,o,r,a){return Object(i.L)(),Object(i.n)("div",s,[Object(i.o)("div",c,[Object(i.o)("div",u,[Object(i.o)("p",null,Object(i.Y)(r.label),1)]),Object(i.o)("div",d,[l,Object(i.o)("div",f,[Object(i.kb)(Object(i.o)("p",{class:"errorMsg"},Object(i.Y)(r.showLogInfo),513),[[i.gb,r.showLog]])]),Object(i.o)("p",p,[b,Object(i.kb)(Object(i.o)("input",{type:"text","onUpdate:modelValue":e[0]||(e[0]=function(t){return r.form.name=t}),class:"accountVal"},null,512),[[i.fb,r.form.name]])]),Object(i.o)("p",m,[h,Object(i.kb)(Object(i.o)("input",{type:"password","onUpdate:modelValue":e[1]||(e[1]=function(t){return r.form.password=t}),class:"passwordVal"},null,512),[[i.fb,r.form.password]])]),Object(i.o)("p",{class:"login-btn",onClick:e[2]||(e[2]=function(){return a.login&&a.login.apply(a,arguments)})},"登录")])])])},r.__scopeId="data-v-581864d3";e.default=r},"8d39":function(t,e,n){"use strict";n("40a7")},b775:function(t,e,n){"use strict";n.d(e,"a",function(){return c});var o=n("d3b7"),r=n("bc3a"),o=n.n(r),r=n("4328"),a=n.n(r),i=n("2bea"),s=n("56d7"),c="/";o.a.defaults.withCredentials=!0,o.a.defaults.headers.post["Content-Type"]="application/x-www-form-urlencoded;charset=UTF-8";o=o.a.create({baseURL:c,timeout:2e5});o.interceptors.request.use(function(t){return"get"===t.method&&(t.paramsSerializer=function(t){return a.a.stringify(t,{arrayFormat:"repeat"})}),t.withCredentials=!0,t},function(t){Promise.reject(t)}),o.interceptors.response.use(function(t){return 2!==t.data.statu?t.data:(i.b.Message({showClose:!0,message:"登录信息丢失,请重新登陆!",type:"error",duration:2e3,offset:100}),void s.app.$router.push({path:"/login"}))},function(t){var e="err:"+t,n={};return t.response?n=t.response.data:(-1!=e.indexOf("timeout")?(n.code=500,n.message="请求超时,请稍后再试"):-1!=e.indexOf("Network Error")?(n.code=500,n.message="网络错误,请稍后再试"):(n.code=500,n.message=""+t),n)}),e.b=o}}]);