Commit 29613b87 by 梁建民

js

parent 110a65ba
......@@ -4,7 +4,8 @@
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build"
"build": "vue-cli-service build",
"dev": "vue-cli-service build --watch"
},
"dependencies": {
"axios": "^0.18.0",
......
......@@ -18,7 +18,8 @@ switch (window.location.hostname) {
urlApi = 'http://api.liexin.com/';
break;
case "m.liexin.com":
url = 'http://m.liexin.com/';
url = 'http://m.liexin.com/v3/';
urlApi = 'http://api.liexin.com/';
break;
case "sz.ichunt.com":
urlApi = 'https://szapi.ichunt.com/';
......@@ -34,13 +35,18 @@ switch (window.location.hostname) {
urlApi = '/api/';
}
export const productionUrl = url;
export const productionUrlApi = urlApi;
export const apis = {
/**
* 首页
*/
index: url + 'index',
index: productionUrl + 'index',
/**
* 获取登录状态
*/
loginCheck: productionUrlApi + 'login/check',
/**
* 获取购物车数量
*/
......@@ -52,6 +58,13 @@ export const services = {
index(params) {
return axios.post(apis.index, params)
},
loginCheck(params) {
return axios.get(apis.loginCheck, {
params: {
data: params
}
})
},
cartCount(params) {
return axios.get(apis.cartCount, {
params: {
......
......@@ -15,7 +15,7 @@ Object.keys(filters).forEach(key => Vue.filter(key, filters[key]));
//设置请求头
Vue.prototype.$http = axios;
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
axios.defaults.withCredentials = true;
Vue.config.productionTip = true;
......
......@@ -6,20 +6,25 @@ import {Toast} from 'vant';
Vue.use(Toast);
const state = {
cartCount: ''
cartCount: '',
loginCheck: false
}
const mutations = {
cartCount(state, payload) {
state.cartCount = payload.data == 0 ? '' : payload.data;
},
loginCheck(state, payload) {
if (payload.data.err_code == 0) {
state.loginCheck = true;
} else {
state.loginCheck = false;
}
}
}
const actions = {
cartCount({commit}, payload) {
var params={
}
Services.cartCount().then(function (res) {
let data = res.data;
if (data.err_code == 0) {
......@@ -34,6 +39,20 @@ const actions = {
duration: 1500
});
});
},
loginCheck({commit}, payload) {
Services.loginCheck().then(function (res) {
let data = res.data;
commit({
type: 'loginCheck',
data: data
});
}).catch(function (err) {
Toast({
message: '网络出现问题,请重试',
duration: 1500
});
});
}
}
......
......@@ -45,9 +45,13 @@
cartCount: state => state.common.cartCount
}),
created() {
/*this.$store.dispatch({
this.$store.dispatch({
type: 'cartCount'
})*/
})
this.$store.dispatch({
type: 'loginCheck'
})
}
}
</script>
\ No newline at end of file
......@@ -7,8 +7,12 @@
<Slide :slidedata="index.rollbanner"></Slide>
</div>
<div class="login-wrap">
<a href="/v3/login?ptag=index-topnav" class="btn">登录</a>
<a href="/v3/user?ptag=index-topnav" class="person-btn" style="display: none"><i></i></a>
<template v-if="loginCheck">
<a href="/v3/user?ptag=index-topnav" class="person-btn"><i></i></a>
</template>
<template v-else>
<a href="/v3/login?ptag=index-topnav" class="btn">登录</a>
</template>
</div>
<div class="search boxsiz">
<div class="search-wrap boxsiz">
......@@ -17,7 +21,7 @@
</div>
<div class="inp boxsiz">
<i></i>
<input type="text" class="boxsiz" placeholder="请输入元器件型号、参数">
<input type="text" @focus="jump" class="boxsiz" placeholder="请输入元器件型号、参数">
</div>
</div>
</div>
......@@ -255,7 +259,8 @@
export default {
name: 'index',
computed: mapState({
index: state => state.home.index
index: state => state.home.index,
loginCheck: state => state.common.loginCheck
}),
data() {
return {
......@@ -274,6 +279,9 @@
setTimeout(() => {
this.isLoading = false;
}, 500);
},
jump() {
window.location.href = '/v3/search/search_index.html?ptag=index-topnav';
}
},
components: {
......
<!DOCTYPE HTML><html lang=zh-CN><head><title></title><meta name=author content=www.ichunt.com><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0,user-scalable=no,minimal-ui"><meta http-equiv=Content-Type content="text/html;charset=utf-8"><meta name=apple-mobile-web-app-capable content=yes><meta name=apple-mobile-web-app-status-bar-style content=black><meta name=format-detection content="telephone=no"><meta http-equiv=Expires content=-1><meta http-equiv=Cache-Control content=no-cache><meta http-equiv=Pragma content=no-cache><meta name=full-screen content=yes><meta name=browsermode content=application><meta name=x5-fullscreen content=true><meta name=x5-page-mode content=app><meta name=description content=猎芯网,快速成长的专业电子元器件商城,贸泽(MOUSER)全系产品、e络盟(element14)树莓派系列产品授权经销商,已获得多轮风险投资。为客户提供电子元器件现货,IC采购,进口报关,电子元器件寄售,供应链金融等一站式电子元器件采购服务。><meta name=keywords content=猎芯网,电子元器件采购,电子元器件商城,电子元器件现货,IC采购网,电子元器件寄售,电子元件,元器件商城,元器件采购,电子商城,><link rel=icon href=//szh5static.ichunt.com/favicon.ico><link rel=stylesheet href=//szh5static.ichunt.com/static/iconfont.css><script src=get_time.php></script><script src=https://res.wx.qq.com/open/js/jweixin-1.3.2.js charset=utf-8></script><script src=//szh5static.ichunt.com/static/flexible.min.js charset=utf-8></script><script src=//szh5static.ichunt.com/static/shence.min.js charset=utf-8></script><link href=//szh5static.ichunt.com/css/chunk-79532a8a.f1694ee3.css rel=prefetch><link href=//szh5static.ichunt.com/js/chunk-79532a8a.e666accf.js rel=prefetch><link href=//szh5static.ichunt.com/css/app.49eecd25.css rel=preload as=style><link href=//szh5static.ichunt.com/css/chunk-vendors.521d5c8e.css rel=preload as=style><link href=//szh5static.ichunt.com/js/app.43cbca5a.js rel=preload as=script><link href=//szh5static.ichunt.com/js/chunk-vendors.a6cc3c8c.js rel=preload as=script><link href=//szh5static.ichunt.com/css/chunk-vendors.521d5c8e.css rel=stylesheet><link href=//szh5static.ichunt.com/css/app.49eecd25.css rel=stylesheet></head><body><noscript><strong>网站出现了一点小问题,正在修复中.......</strong></noscript><div id=app></div><script>//设置cookie
<!DOCTYPE HTML><html lang=zh-CN><head><title></title><meta name=author content=www.ichunt.com><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0,user-scalable=no,minimal-ui"><meta http-equiv=Content-Type content="text/html;charset=utf-8"><meta name=apple-mobile-web-app-capable content=yes><meta name=apple-mobile-web-app-status-bar-style content=black><meta name=format-detection content="telephone=no"><meta http-equiv=Expires content=-1><meta http-equiv=Cache-Control content=no-cache><meta http-equiv=Pragma content=no-cache><meta name=full-screen content=yes><meta name=browsermode content=application><meta name=x5-fullscreen content=true><meta name=x5-page-mode content=app><meta name=description content=猎芯网,快速成长的专业电子元器件商城,贸泽(MOUSER)全系产品、e络盟(element14)树莓派系列产品授权经销商,已获得多轮风险投资。为客户提供电子元器件现货,IC采购,进口报关,电子元器件寄售,供应链金融等一站式电子元器件采购服务。><meta name=keywords content=猎芯网,电子元器件采购,电子元器件商城,电子元器件现货,IC采购网,电子元器件寄售,电子元件,元器件商城,元器件采购,电子商城,><link rel=icon href=//szh5static.ichunt.com/favicon.ico><link rel=stylesheet href=//szh5static.ichunt.com/static/iconfont.css><script src=get_time.php></script><script src=https://res.wx.qq.com/open/js/jweixin-1.3.2.js charset=utf-8></script><script src=//szh5static.ichunt.com/static/flexible.min.js charset=utf-8></script><script src=//szh5static.ichunt.com/static/shence.min.js charset=utf-8></script><link href=//szh5static.ichunt.com/css/chunk-4d270c35.32df4f1b.css rel=prefetch><link href=//szh5static.ichunt.com/js/chunk-4d270c35.fd6c1902.js rel=prefetch><link href=//szh5static.ichunt.com/css/app.49eecd25.css rel=preload as=style><link href=//szh5static.ichunt.com/css/chunk-vendors.521d5c8e.css rel=preload as=style><link href=//szh5static.ichunt.com/js/app.642b286d.js rel=preload as=script><link href=//szh5static.ichunt.com/js/chunk-vendors.a6cc3c8c.js rel=preload as=script><link href=//szh5static.ichunt.com/css/chunk-vendors.521d5c8e.css rel=stylesheet><link href=//szh5static.ichunt.com/css/app.49eecd25.css rel=stylesheet></head><body><noscript><strong>网站出现了一点小问题,正在修复中.......</strong></noscript><div id=app></div><script>//设置cookie
function SetCookie(name, value, time, domain)//两个参数,一个是cookie的名子,一个是值,一个是天数
{
domain = domain ? ";domain=" + domain : "";
......@@ -219,4 +219,4 @@
user_rank: '0'
});
sensors.quick('autoTrack');
}</script><script src=//szh5static.ichunt.com/js/chunk-vendors.a6cc3c8c.js></script><script src=//szh5static.ichunt.com/js/app.43cbca5a.js></script></body></html>
\ No newline at end of file
}</script><script src=//szh5static.ichunt.com/js/chunk-vendors.a6cc3c8c.js></script><script src=//szh5static.ichunt.com/js/app.642b286d.js></script></body></html>
\ No newline at end of file
(function(t){function e(e){for(var r,a,c=e[0],u=e[1],s=e[2],f=0,l=[];f<c.length;f++)a=c[f],o[a]&&l.push(o[a][0]),o[a]=0;for(r in u)Object.prototype.hasOwnProperty.call(u,r)&&(t[r]=u[r]);p&&p(e);while(l.length)l.shift()();return i.push.apply(i,s||[]),n()}function n(){for(var t,e=0;e<i.length;e++){for(var n=i[e],r=!0,a=1;a<n.length;a++){var c=n[a];0!==o[c]&&(r=!1)}r&&(i.splice(e--,1),t=u(u.s=n[0]))}return t}var r={},a={app:0},o={app:0},i=[];function c(t){return u.p+"js/"+({}[t]||t)+"."+{"chunk-79532a8a":"e666accf"}[t]+".js"}function u(e){if(r[e])return r[e].exports;var n=r[e]={i:e,l:!1,exports:{}};return t[e].call(n.exports,n,n.exports,u),n.l=!0,n.exports}u.e=function(t){var e=[],n={"chunk-79532a8a":1};a[t]?e.push(a[t]):0!==a[t]&&n[t]&&e.push(a[t]=new Promise(function(e,n){for(var r="css/"+({}[t]||t)+"."+{"chunk-79532a8a":"f1694ee3"}[t]+".css",o=u.p+r,i=document.getElementsByTagName("link"),c=0;c<i.length;c++){var s=i[c],f=s.getAttribute("data-href")||s.getAttribute("href");if("stylesheet"===s.rel&&(f===r||f===o))return e()}var l=document.getElementsByTagName("style");for(c=0;c<l.length;c++){s=l[c],f=s.getAttribute("data-href");if(f===r||f===o)return e()}var p=document.createElement("link");p.rel="stylesheet",p.type="text/css",p.onload=e,p.onerror=function(e){var r=e&&e.target&&e.target.src||o,i=new Error("Loading CSS chunk "+t+" failed.\n("+r+")");i.request=r,delete a[t],p.parentNode.removeChild(p),n(i)},p.href=o;var d=document.getElementsByTagName("head")[0];d.appendChild(p)}).then(function(){a[t]=0}));var r=o[t];if(0!==r)if(r)e.push(r[2]);else{var i=new Promise(function(e,n){r=o[t]=[e,n]});e.push(r[2]=i);var s,f=document.createElement("script");f.charset="utf-8",f.timeout=120,u.nc&&f.setAttribute("nonce",u.nc),f.src=c(t),s=function(e){f.onerror=f.onload=null,clearTimeout(l);var n=o[t];if(0!==n){if(n){var r=e&&("load"===e.type?"missing":e.type),a=e&&e.target&&e.target.src,i=new Error("Loading chunk "+t+" failed.\n("+r+": "+a+")");i.type=r,i.request=a,n[1](i)}o[t]=void 0}};var l=setTimeout(function(){s({type:"timeout",target:f})},12e4);f.onerror=f.onload=s,document.head.appendChild(f)}return Promise.all(e)},u.m=t,u.c=r,u.d=function(t,e,n){u.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},u.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},u.t=function(t,e){if(1&e&&(t=u(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(u.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)u.d(n,r,function(e){return t[e]}.bind(null,r));return n},u.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return u.d(e,"a",e),e},u.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},u.p="//szh5static.ichunt.com/",u.oe=function(t){throw console.error(t),t};var s=window["webpackJsonp"]=window["webpackJsonp"]||[],f=s.push.bind(s);s.push=e,s=s.slice();for(var l=0;l<s.length;l++)e(s[l]);var p=f;i.push([0,"chunk-vendors"]),n()})({0:function(t,e,n){t.exports=n("56d7")},"56d7":function(t,e,n){"use strict";n.r(e);var r=n("0ec6"),a=n.n(r),o=(n("c764"),n("9f07"),n("0964"),n("1cc5")),i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{attrs:{id:"app"}},[n("keep-alive",{attrs:{exclude:""}},[n("router-view",{staticClass:"router-view"})],1)],1)},c=[],u={name:"app"},s=u,f=n("25c1"),l=Object(f["a"])(s,i,c,!1,null,null,null);l.options.__file="App.vue";var p=l.exports,d=n("7f43"),h=n.n(d),m=(n("0a16"),n("081a")),v=function(t){return n.e("chunk-79532a8a").then(function(){var e=[n("9553")];t.apply(null,e)}.bind(this)).catch(n.oe)};o["a"].use(m["a"]);var g=[{path:"/home",component:v,meta:{title:"猎芯网"}},{path:"/",redirect:"/home"},{path:"*",redirect:"/"}];g.forEach(function(t){t.path=t.path||"/"+(t.name||"")});var w=new m["a"]({routes:g});w.beforeEach(function(t,e,n){var r=t.meta&&t.meta.title;r&&(document.title=r),n()});var y,b,k=n("52c1");switch(window.location.hostname){case"www.ichunt.com":y="https://api.ichunt.com/";break;case"www.liexin.com":y="http://api.liexin.com/";break;case"m.liexin.com":b="http://m.liexin.com/";break;case"sz.ichunt.com":y="https://szapi.ichunt.com/";break;case"szm.ichunt.com":y="https://szapi.ichunt.com/",b="https://szm.ichunt.com/v3/";break;case"t.ichunt.com":y="https://api.ichunt.com/";break;default:y="/api/"}var x=y,C={index:b+"index",cartCount:x+"cart/count"},T={index:function(t){return h.a.post(C.index,t)},cartCount:function(t){return h.a.get(C.cartCount,{params:{data:t}})}},E=n("6ef6"),j=(n("ac74"),n("9029"),n("ab01")),A=n.n(j),_=(n("4ddc"),0),O=8;function P(t){return N(S(q(t),t.length*O))}function S(t,e){t[e>>5]|=128<<24-e%32,t[15+(e+64>>9<<4)]=e;for(var n=Array(80),r=1732584193,a=-271733879,o=-1732584194,i=271733878,c=-1009589776,u=0;u<t.length;u+=16){for(var s=r,f=a,l=o,p=i,d=c,h=0;h<80;h++){n[h]=h<16?t[u+h]:B(n[h-3]^n[h-8]^n[h-14]^n[h-16],1);var m=D(D(B(r,5),M(h,a,o,i)),D(D(c,n[h]),z(h)));c=i,i=o,o=B(a,30),a=r,r=m}r=D(r,s),a=D(a,f),o=D(o,l),i=D(i,p),c=D(c,d)}return Array(r,a,o,i,c)}function M(t,e,n,r){return t<20?e&n|~e&r:t<40?e^n^r:t<60?e&n|e&r|n&r:e^n^r}function z(t){return t<20?1518500249:t<40?1859775393:t<60?-1894007588:-899497514}function D(t,e){var n=(65535&t)+(65535&e),r=(t>>16)+(e>>16)+(n>>16);return r<<16|65535&n}function B(t,e){return t<<e|t>>>32-e}function q(t){for(var e=Array(),n=(1<<O)-1,r=0;r<t.length*O;r+=O)e[r>>5]|=(t.charCodeAt(r/O)&n)<<24-r%32;return e}function N(t){for(var e=_?"0123456789ABCDEF":"0123456789abcdef",n="",r=0;r<4*t.length;r++)n+=e.charAt(t[r>>2]>>8*(3-r%4)+4&15)+e.charAt(t[r>>2]>>8*(3-r%4)&15);return n}var F=function(t){var e=new Date;e.setTime(1e3*t);var n=e.getFullYear(),r=e.getMonth()+1;r=r<10?"0"+r:r;var a=e.getDate();a=a<10?"0"+a:a;var o=e.getHours();o=o<10?"0"+o:o;var i=e.getMinutes(),c=e.getSeconds();return i=i<10?"0"+i:i,c=c<10?"0"+c:c,n+"-"+r+"-"+a+" "},Y={dateTimeFormate:F},$=n("0427"),G={setCookie:function(t,e,n,r){r=r?";domain="+r:"";var a=n,o=new Date;return o.setTime(o.getTime()+24*a*60*60*1e3),document.cookie=t+"="+encodeURIComponent(e)+";expires="+o.toGMTString()+";path=/"+r,!0},getCookie:function(t){for(var e=document.cookie,n=e.split("; "),r=0;r<n.length;r++){var a=n[r].split("=");if(t==a[0])return a[1]}return""},delCookie:function(t){var e=new Date;e.setTime(e.getTime()-1);var n=this.getCookie(t);null!=n&&(document.cookie=t+"="+n+";expires="+e.toGMTString())},getParams:function(t){var e=window.fwtime-Math.floor((new Date).getTime()/1e3),n=Math.floor((new Date).getTime()/1e3)+e,r=getCookie("Yo4teW_gid"),o=[],i={},c="",u="",s="",f={pf:2,qwertyuiop:n,Yo4teW_gid:r},l=A()({},f,t);a()(l).forEach(function(t,e,n){o.push(t)}),o=o.sort(),o.forEach(function(t,e,n){i[o[e]]=l[o[e]]}),a()(i).forEach(function(t,e,n){c+=t+"="+i[t]}),u=c.replace(/[^0-9a-zA-Z]/g,""),u=u.toUpperCase();for(var p=0;p<u.length;p++)"A"!=u[p]&&"B"!=u[p]&&"C"!=u[p]&&(s+=u[p]);c=P(s);var d=A()({},t,{asdfghjkl:c},{qwertyuiop:n},{pf:2});return $.stringify(d)}};o["a"].use(E["d"]);var J={index:{}},L={index:function(t,e){t.index=e.data}},U={index:function(t,e){var n=t.commit,r=G.getParams();T.index(r).then(function(t){var e=t.data;0==e.err_code&&n({type:"index",data:e.data})}).catch(function(t){Object(E["d"])({message:"网络出现问题,请重试",duration:1500})})}},W={},H={state:J,mutations:L,actions:U,getters:W};o["a"].use(E["d"]);var I={cartCount:""},R={cartCount:function(t,e){t.cartCount=0==e.data?"":e.data}},Z={cartCount:function(t,e){var n=t.commit;T.cartCount().then(function(t){var e=t.data;0==e.err_code&&n({type:"cartCount",data:e.data})}).catch(function(t){Object(E["d"])({message:"网络出现问题,请重试",duration:1500})})}},K={},Q={state:I,mutations:R,actions:Z,getters:K};o["a"].use(k["a"]);var V=new k["a"].Store({modules:{home:H,common:Q}});n("e1a5"),n("bfd9");a()(Y).forEach(function(t){return o["a"].filter(t,Y[t])}),o["a"].prototype.$http=h.a,h.a.defaults.headers.post["Content-Type"]="application/x-www-form-urlencoded",o["a"].config.productionTip=!0,new o["a"]({router:w,store:V,render:function(t){return t(p)}}).$mount("#app")},bfd9:function(t,e,n){}});
//# sourceMappingURL=app.43cbca5a.js.map
\ No newline at end of file
(function(t){function e(e){for(var r,a,c=e[0],u=e[1],s=e[2],f=0,l=[];f<c.length;f++)a=c[f],o[a]&&l.push(o[a][0]),o[a]=0;for(r in u)Object.prototype.hasOwnProperty.call(u,r)&&(t[r]=u[r]);d&&d(e);while(l.length)l.shift()();return i.push.apply(i,s||[]),n()}function n(){for(var t,e=0;e<i.length;e++){for(var n=i[e],r=!0,a=1;a<n.length;a++){var c=n[a];0!==o[c]&&(r=!1)}r&&(i.splice(e--,1),t=u(u.s=n[0]))}return t}var r={},a={app:0},o={app:0},i=[];function c(t){return u.p+"js/"+({}[t]||t)+"."+{"chunk-4d270c35":"fd6c1902"}[t]+".js"}function u(e){if(r[e])return r[e].exports;var n=r[e]={i:e,l:!1,exports:{}};return t[e].call(n.exports,n,n.exports,u),n.l=!0,n.exports}u.e=function(t){var e=[],n={"chunk-4d270c35":1};a[t]?e.push(a[t]):0!==a[t]&&n[t]&&e.push(a[t]=new Promise(function(e,n){for(var r="css/"+({}[t]||t)+"."+{"chunk-4d270c35":"32df4f1b"}[t]+".css",o=u.p+r,i=document.getElementsByTagName("link"),c=0;c<i.length;c++){var s=i[c],f=s.getAttribute("data-href")||s.getAttribute("href");if("stylesheet"===s.rel&&(f===r||f===o))return e()}var l=document.getElementsByTagName("style");for(c=0;c<l.length;c++){s=l[c],f=s.getAttribute("data-href");if(f===r||f===o)return e()}var d=document.createElement("link");d.rel="stylesheet",d.type="text/css",d.onload=e,d.onerror=function(e){var r=e&&e.target&&e.target.src||o,i=new Error("Loading CSS chunk "+t+" failed.\n("+r+")");i.request=r,delete a[t],d.parentNode.removeChild(d),n(i)},d.href=o;var h=document.getElementsByTagName("head")[0];h.appendChild(d)}).then(function(){a[t]=0}));var r=o[t];if(0!==r)if(r)e.push(r[2]);else{var i=new Promise(function(e,n){r=o[t]=[e,n]});e.push(r[2]=i);var s,f=document.createElement("script");f.charset="utf-8",f.timeout=120,u.nc&&f.setAttribute("nonce",u.nc),f.src=c(t),s=function(e){f.onerror=f.onload=null,clearTimeout(l);var n=o[t];if(0!==n){if(n){var r=e&&("load"===e.type?"missing":e.type),a=e&&e.target&&e.target.src,i=new Error("Loading chunk "+t+" failed.\n("+r+": "+a+")");i.type=r,i.request=a,n[1](i)}o[t]=void 0}};var l=setTimeout(function(){s({type:"timeout",target:f})},12e4);f.onerror=f.onload=s,document.head.appendChild(f)}return Promise.all(e)},u.m=t,u.c=r,u.d=function(t,e,n){u.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},u.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},u.t=function(t,e){if(1&e&&(t=u(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(u.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)u.d(n,r,function(e){return t[e]}.bind(null,r));return n},u.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return u.d(e,"a",e),e},u.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},u.p="//szh5static.ichunt.com/",u.oe=function(t){throw console.error(t),t};var s=window["webpackJsonp"]=window["webpackJsonp"]||[],f=s.push.bind(s);s.push=e,s=s.slice();for(var l=0;l<s.length;l++)e(s[l]);var d=f;i.push([0,"chunk-vendors"]),n()})({0:function(t,e,n){t.exports=n("56d7")},"56d7":function(t,e,n){"use strict";n.r(e);var r=n("0ec6"),a=n.n(r),o=(n("c764"),n("9f07"),n("0964"),n("1cc5")),i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{attrs:{id:"app"}},[n("keep-alive",{attrs:{exclude:""}},[n("router-view",{staticClass:"router-view"})],1)],1)},c=[],u={name:"app"},s=u,f=n("25c1"),l=Object(f["a"])(s,i,c,!1,null,null,null);l.options.__file="App.vue";var d=l.exports,h=n("7f43"),p=n.n(h),m=(n("0a16"),n("081a")),g=function(t){return n.e("chunk-4d270c35").then(function(){var e=[n("9553")];t.apply(null,e)}.bind(this)).catch(n.oe)};o["a"].use(m["a"]);var v=[{path:"/home",component:g,meta:{title:"猎芯网"}},{path:"/",redirect:"/home"},{path:"*",redirect:"/"}];v.forEach(function(t){t.path=t.path||"/"+(t.name||"")});var w=new m["a"]({routes:v});w.beforeEach(function(t,e,n){var r=t.meta&&t.meta.title;r&&(document.title=r),n()});var b,k,y=n("52c1");switch(window.location.hostname){case"www.ichunt.com":b="https://api.ichunt.com/";break;case"www.liexin.com":b="http://api.liexin.com/";break;case"m.liexin.com":k="http://m.liexin.com/v3/",b="http://api.liexin.com/";break;case"sz.ichunt.com":b="https://szapi.ichunt.com/";break;case"szm.ichunt.com":b="https://szapi.ichunt.com/",k="https://szm.ichunt.com/v3/";break;case"t.ichunt.com":b="https://api.ichunt.com/";break;default:b="/api/"}var C=k,x=b,T={index:C+"index",loginCheck:x+"login/check",cartCount:x+"cart/count"},j={index:function(t){return p.a.post(T.index,t)},loginCheck:function(t){return p.a.get(T.loginCheck,{params:{data:t}})},cartCount:function(t){return p.a.get(T.cartCount,{params:{data:t}})}},E=n("6ef6"),_=(n("ac74"),n("9029"),n("ab01")),A=n.n(_),O=(n("4ddc"),0),P=8;function S(t){return F(M(N(t),t.length*P))}function M(t,e){t[e>>5]|=128<<24-e%32,t[15+(e+64>>9<<4)]=e;for(var n=Array(80),r=1732584193,a=-271733879,o=-1732584194,i=271733878,c=-1009589776,u=0;u<t.length;u+=16){for(var s=r,f=a,l=o,d=i,h=c,p=0;p<80;p++){n[p]=p<16?t[u+p]:q(n[p-3]^n[p-8]^n[p-14]^n[p-16],1);var m=B(B(q(r,5),z(p,a,o,i)),B(B(c,n[p]),D(p)));c=i,i=o,o=q(a,30),a=r,r=m}r=B(r,s),a=B(a,f),o=B(o,l),i=B(i,d),c=B(c,h)}return Array(r,a,o,i,c)}function z(t,e,n,r){return t<20?e&n|~e&r:t<40?e^n^r:t<60?e&n|e&r|n&r:e^n^r}function D(t){return t<20?1518500249:t<40?1859775393:t<60?-1894007588:-899497514}function B(t,e){var n=(65535&t)+(65535&e),r=(t>>16)+(e>>16)+(n>>16);return r<<16|65535&n}function q(t,e){return t<<e|t>>>32-e}function N(t){for(var e=Array(),n=(1<<P)-1,r=0;r<t.length*P;r+=P)e[r>>5]|=(t.charCodeAt(r/P)&n)<<24-r%32;return e}function F(t){for(var e=O?"0123456789ABCDEF":"0123456789abcdef",n="",r=0;r<4*t.length;r++)n+=e.charAt(t[r>>2]>>8*(3-r%4)+4&15)+e.charAt(t[r>>2]>>8*(3-r%4)&15);return n}var Y=function(t){var e=new Date;e.setTime(1e3*t);var n=e.getFullYear(),r=e.getMonth()+1;r=r<10?"0"+r:r;var a=e.getDate();a=a<10?"0"+a:a;var o=e.getHours();o=o<10?"0"+o:o;var i=e.getMinutes(),c=e.getSeconds();return i=i<10?"0"+i:i,c=c<10?"0"+c:c,n+"-"+r+"-"+a+" "},$={dateTimeFormate:Y},G=n("0427"),J={setCookie:function(t,e,n,r){r=r?";domain="+r:"";var a=n,o=new Date;return o.setTime(o.getTime()+24*a*60*60*1e3),document.cookie=t+"="+encodeURIComponent(e)+";expires="+o.toGMTString()+";path=/"+r,!0},getCookie:function(t){for(var e=document.cookie,n=e.split("; "),r=0;r<n.length;r++){var a=n[r].split("=");if(t==a[0])return a[1]}return""},delCookie:function(t){var e=new Date;e.setTime(e.getTime()-1);var n=this.getCookie(t);null!=n&&(document.cookie=t+"="+n+";expires="+e.toGMTString())},getParams:function(t){var e=window.fwtime-Math.floor((new Date).getTime()/1e3),n=Math.floor((new Date).getTime()/1e3)+e,r=getCookie("Yo4teW_gid"),o=[],i={},c="",u="",s="",f={pf:2,qwertyuiop:n,Yo4teW_gid:r},l=A()({},f,t);a()(l).forEach(function(t,e,n){o.push(t)}),o=o.sort(),o.forEach(function(t,e,n){i[o[e]]=l[o[e]]}),a()(i).forEach(function(t,e,n){c+=t+"="+i[t]}),u=c.replace(/[^0-9a-zA-Z]/g,""),u=u.toUpperCase();for(var d=0;d<u.length;d++)"A"!=u[d]&&"B"!=u[d]&&"C"!=u[d]&&(s+=u[d]);c=S(s);var h=A()({},t,{asdfghjkl:c},{qwertyuiop:n},{pf:2});return G.stringify(h)}};o["a"].use(E["d"]);var L={index:{}},U={index:function(t,e){t.index=e.data}},W={index:function(t,e){var n=t.commit,r=J.getParams();j.index(r).then(function(t){var e=t.data;0==e.err_code&&n({type:"index",data:e.data})}).catch(function(t){Object(E["d"])({message:"网络出现问题,请重试",duration:1500})})}},H={},I={state:L,mutations:U,actions:W,getters:H};o["a"].use(E["d"]);var R={cartCount:"",loginCheck:!1},Z={cartCount:function(t,e){t.cartCount=0==e.data?"":e.data},loginCheck:function(t,e){0==e.data.err_code?t.loginCheck=!0:t.loginCheck=!1}},K={cartCount:function(t,e){var n=t.commit;j.cartCount().then(function(t){var e=t.data;0==e.err_code&&n({type:"cartCount",data:e.data})}).catch(function(t){Object(E["d"])({message:"网络出现问题,请重试",duration:1500})})},loginCheck:function(t,e){var n=t.commit;j.loginCheck().then(function(t){var e=t.data;n({type:"loginCheck",data:e})}).catch(function(t){Object(E["d"])({message:"网络出现问题,请重试",duration:1500})})}},Q={},V={state:R,mutations:Z,actions:K,getters:Q};o["a"].use(y["a"]);var X=new y["a"].Store({modules:{home:I,common:V}});n("e1a5"),n("bfd9");a()($).forEach(function(t){return o["a"].filter(t,$[t])}),o["a"].prototype.$http=p.a,p.a.defaults.headers.post["Content-Type"]="application/x-www-form-urlencoded",p.a.defaults.withCredentials=!0,o["a"].config.productionTip=!0,new o["a"]({router:w,store:X,render:function(t){return t(d)}}).$mount("#app")},bfd9:function(t,e,n){}});
//# sourceMappingURL=app.642b286d.js.map
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment