2 lines
9.8 KiB
JavaScript
2 lines
9.8 KiB
JavaScript
(function(e){function t(t){for(var r,o,c=t[0],i=t[1],f=t[2],s=0,l=[];s<c.length;s++)o=c[s],Object.prototype.hasOwnProperty.call(a,o)&&a[o]&&l.push(a[o][0]),a[o]=0;for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r]);d&&d(t);while(l.length)l.shift()();return u.push.apply(u,f||[]),n()}function n(){for(var e,t=0;t<u.length;t++){for(var n=u[t],r=!0,o=1;o<n.length;o++){var c=n[o];0!==a[c]&&(r=!1)}r&&(u.splice(t--,1),e=i(i.s=n[0]))}return e}var r={},o={app:0},a={app:0},u=[];function c(e){return i.p+"js/"+({}[e]||e)+"."+{"chunk-0f226f0a":"d8650179","chunk-72ef8297":"586104ce"}[e]+".js"}function i(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,i),n.l=!0,n.exports}i.e=function(e){var t=[],n={"chunk-0f226f0a":1,"chunk-72ef8297":1};o[e]?t.push(o[e]):0!==o[e]&&n[e]&&t.push(o[e]=new Promise((function(t,n){for(var r="css/"+({}[e]||e)+"."+{"chunk-0f226f0a":"0f952df5","chunk-72ef8297":"71bfa63a"}[e]+".css",a=i.p+r,u=document.getElementsByTagName("link"),c=0;c<u.length;c++){var f=u[c],s=f.getAttribute("data-href")||f.getAttribute("href");if("stylesheet"===f.rel&&(s===r||s===a))return t()}var l=document.getElementsByTagName("style");for(c=0;c<l.length;c++){f=l[c],s=f.getAttribute("data-href");if(s===r||s===a)return t()}var d=document.createElement("link");d.rel="stylesheet",d.type="text/css",d.onload=t,d.onerror=function(t){var r=t&&t.target&&t.target.src||a,u=new Error("Loading CSS chunk "+e+" failed.\n("+r+")");u.code="CSS_CHUNK_LOAD_FAILED",u.request=r,delete o[e],d.parentNode.removeChild(d),n(u)},d.href=a;var p=document.getElementsByTagName("head")[0];p.appendChild(d)})).then((function(){o[e]=0})));var r=a[e];if(0!==r)if(r)t.push(r[2]);else{var u=new Promise((function(t,n){r=a[e]=[t,n]}));t.push(r[2]=u);var f,s=document.createElement("script");s.charset="utf-8",s.timeout=120,i.nc&&s.setAttribute("nonce",i.nc),s.src=c(e);var l=new Error;f=function(t){s.onerror=s.onload=null,clearTimeout(d);var n=a[e];if(0!==n){if(n){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;l.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",l.name="ChunkLoadError",l.type=r,l.request=o,n[1](l)}a[e]=void 0}};var d=setTimeout((function(){f({type:"timeout",target:s})}),12e4);s.onerror=s.onload=f,document.head.appendChild(s)}return Promise.all(t)},i.m=e,i.c=r,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(n,r,function(t){return e[t]}.bind(null,r));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="/kefu/",i.oe=function(e){throw console.error(e),e};var f=window["webpackJsonp"]=window["webpackJsonp"]||[],s=f.push.bind(f);f.push=t,f=f.slice();for(var l=0;l<f.length;l++)t(f[l]);var d=s;u.push([0,"chunk-vendors"]),n()})({0:function(e,t,n){e.exports=n("56d7")},"24ab":function(e,t,n){e.exports={primary:"#4073FA"}},4360:function(e,t,n){"use strict";var r=n("2b0e"),o=n("2f62"),a=n("bfa9"),u=(n("d3b7"),n("b562")),c={token:"",userInfo:{}},i={SET_USER_INFO:function(e,t){e.userInfo=t},SET_TOKEN:function(e,t){e.token=t},clearUserInfo:function(e){e.userInfo={}}},f={login:function(e,t){var n=e.commit;return new Promise((function(e,r){Object(u["e"])(t).then((function(t){n("SET_TOKEN",t.token),e(t)})).catch((function(e){r(e)}))}))},getUserInfo:function(e){var t=e.commit;return new Promise((function(e,n){Object(u["d"])().then((function(n){t("SET_USER_INFO",n),e(n)})).catch((function(e){}))}))},logout:function(e){var t=e.commit;return new Promise((function(e,n){t("SET_TOKEN",""),t("clearUserInfo"),e()}))}},s={state:c,mutations:i,actions:f},l=s,d={config:{}},p={setConfig:function(e,t){e.config=t}},h={},m={state:d,mutations:p,actions:h},g=m,b={user:l,app:g},v={token:function(e){return e.user.token||null},shopId:function(e){var t;return(null===(t=e.user.userInfo)||void 0===t?void 0:t.shop_id)||0},userInfo:function(e){return e.user.userInfo},baseUrl:function(e){return e.app.config.base_domain},copyright:function(e){return e.app.config.company_name},wsUrl:function(e){return e.app.config.ws_domain}};r["default"].use(o["a"]);var y=new a["a"]({key:"vuexbase",storage:window.localStorage,modules:["user"]});t["a"]=new o["a"].Store({modules:b,getters:v,plugins:[y.plugin]})},"56d7":function(e,t,n){"use strict";n.r(t);n("e260"),n("e6cf"),n("cca6"),n("a79d");var r=n("2b0e"),o=(n("be3b"),function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"app"}},[e.routerAlive?n("router-view"):e._e()],1)}),a=[],u=n("b562"),c={data:function(){return{routerAlive:!0}},provide:function(){return{reload:this.reload}},methods:{reload:function(){var e=this;this.routerAlive=!1,this.$nextTick((function(){e.routerAlive=!0}))}},created:function(){var e=this;Object(u["c"])().then((function(t){e.$store.commit("setConfig",t);var n=document.querySelector('link[rel="icon"]');n?n.href=t.web_favicon:(n=document.createElement("link"),n.rel="icon",n.href=t.web_favicon,document.head.appendChild(n))}))}},i=c,f=(n("5c0b"),n("2877")),s=Object(f["a"])(i,o,a,!1,null,null,null),l=s.exports,d=n("a18c"),p=n("4360"),h=n("5c96"),m=n.n(h);n("24ab");r["default"].use(m.a);n("caad"),n("b0c0");var g=n("323e"),b=n.n(g),v="/login",y="/",k=["login"];b.a.configure({showSpinner:!1}),d["a"].beforeEach((function(e,t,n){var r;b.a.start(),(null===(r=e.meta)||void 0===r?void 0:r.title)&&(document.title=e.meta.title);var o=e.query.token;o&&p["a"].commit("SET_TOKEN",o),o=o||p["a"].getters.token,o?e.path===v?n({path:y}):n():k.includes(e.name)?n():n({path:v,query:{redirect:e.fullPath}})})),d["a"].afterEach((function(){b.a.done()}));n("bb80"),n("52b6");var w=n("10a7");r["default"].component("overlay-scrollbars",w["a"]),r["default"].config.productionTip=!1,new r["default"]({router:d["a"],store:p["a"],render:function(e){return e(l)}}).$mount("#app")},"5c0b":function(e,t,n){"use strict";n("9c0c")},"9c0c":function(e,t,n){e.exports={primary:"#4073FA"}},a18c:function(e,t,n){"use strict";n("d3b7"),n("3ca3"),n("ddb0");var r=n("2b0e"),o=n("8c4f");r["default"].use(o["a"]);var a=[{path:"*",redirect:"/error/404"},{path:"/",name:"index",meta:{title:"客服"},component:function(){return n.e("chunk-0f226f0a").then(n.bind(null,"2222"))}},{path:"/login",name:"login",meta:{title:"登录"},component:function(){return n.e("chunk-72ef8297").then(n.bind(null,"9760"))}}],u=new o["a"]({mode:"history",base:"/kefu/",routes:a});t["a"]=u},b562:function(e,t,n){"use strict";n.d(t,"e",(function(){return a})),n.d(t,"b",(function(){return u})),n.d(t,"a",(function(){return c})),n.d(t,"g",(function(){return i})),n.d(t,"f",(function(){return f})),n.d(t,"h",(function(){return s})),n.d(t,"i",(function(){return l})),n.d(t,"d",(function(){return d})),n.d(t,"c",(function(){return p}));var r=n("5530"),o=n("be3b"),a=function(e){return o["a"].post("/kefuapi/account/login",Object(r["a"])(Object(r["a"])({},e),{},{client:5}))},u=function(e){return o["a"].get("/kefuapi/chat/user",{params:e})},c=function(e){return o["a"].get("/kefuapi/chat/record",{params:e})},i=function(e){return o["a"].get("/kefuapi/chat/online",{params:e})},f=function(e){return o["a"].get("/kefuapi/chat/reply",{params:e})},s=function(e){return o["a"].get("/kefuapi/chat/userInfo",{params:e})},l=function(e){return o["a"].get("/kefuapi/chat/order",{params:e})},d=function(){return o["a"].get("/kefuapi/chat/kefuInfo")},p=function(){return o["a"].get("/kefuapi/chat/config")}},bb80:function(e,t,n){},be3b:function(e,t,n){"use strict";n("d3b7"),n("ac1f"),n("5319");var r=n("2b0e"),o=n("4360"),a=n("bc3a"),u=n.n(a),c=n("a18c"),i=n("db49"),f=n("5c96"),s=n("ca00"),l={success:function(e){var t=e.show,n=e.msg,r=e.data;return 1*t&&Object(f["Message"])({type:"success",message:n}),r},error:function(e){var t=e.show,n=e.msg;return 1*t&&Object(f["Message"])({type:"error",message:n}),console.log("Error..."),Promise.reject()},redirect:Object(s["c"])((function(){return o["a"].dispatch("logout"),c["a"].replace("/login"),Promise.reject()}))},d={baseURL:"".concat(i["a"].baseURL),headers:{"content-type":"application/json"}},p=u.a.create(d);p.interceptors.request.use((function(e){var t=o["a"].getters.token;return t&&(e.headers["token"]=t),e}),(function(e){return Promise.reject(e)})),p.interceptors.response.use((function(e){var t=e.data.code;switch(t){case 1:return l.success(e.data);case 0:return l.error(e.data);case-1:return l.redirect(e.data)}}),(function(e){return Object(f["Message"])({type:"error",message:"系统错误,请稍候再试"}),Promise.reject(e)})),Plugin.install=function(e,t){e.axios=p,window.axios=p,Object.defineProperties(e.prototype,{axios:{get:function(){return p}},$axios:{get:function(){return p}}})},r["default"].use(Plugin),t["a"]=p},ca00:function(e,t,n){"use strict";n.d(t,"c",(function(){return r})),n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return a}));n("d3b7"),n("99af"),n("25f0"),n("d9e2"),n("a15b"),n("159b");var r=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3,n=new Date(0).getTime();return function(){var r=(new Date).getTime();if(r-n>t){n=r;for(var o=arguments.length,a=new Array(o),u=0;u<o;u++)a[u]=arguments[u];return e(a)}}};function o(e,t){var n=null;return function(){var r=arguments,o=this;n&&clearTimeout(n),n=setTimeout((function(){return t.apply(o,r)}),e)}}var a=function(e){var t=[],n=function(n){var r=e[n];Array.isArray(r)?r.forEach((function(e){t.push(n+"="+e)})):t.push(n+"="+r)};for(var r in e)n(r);return t.join("&")}},db49:function(e,t,n){"use strict";t["a"]={version:"1.3.1",baseURL:""}}});
|
|
//# sourceMappingURL=app.837b8e0c.js.map
|