Forráskód Böngészése

Merge remote-tracking branch 'origin/master'

wangdy 8 éve
szülő
commit
dcc1900bc1

+ 14 - 1
app.html

@@ -6,7 +6,7 @@
   <link rel="stylesheet" type="text/css" href="https://cdn.bootcss.com/element-ui/1.3.7/theme-default/index.css"/>
   <link rel="stylesheet" type="text/css" href="https://at.alicdn.com/t/font_0d1jjt5tukcblnmi.css"/>
   <link rel="stylesheet" type="text/css" href="https://cdn.bootcss.com/Swiper/3.4.2/css/swiper.css"/>
-  <link rel="stylesheet" type="text/css" href="http://at.alicdn.com/t/font_452262_1qlk0md3oua6ecdi.css"/>
+  <!--<link rel="stylesheet" type="text/css" href="https://at.alicdn.com/t/font_452262_1qlk0md3oua6ecdi.css"/>-->
   {{ HEAD }}
   <script>
     var _hmt = _hmt || [];
@@ -22,12 +22,25 @@
         appendScript('https://cdn.bootcss.com/html5shiv/r29/html5.min.js')
         appendScript('https://cdn.bootcss.com/js-polyfills/0.1.33/polyfill.min.js')
       }
+      // cnzz
       var hm = d.createElement("script");
       hm.src = "https://hm.baidu.com/hm.js?34793672f88552a77437f2cee7864118;"
       var s = d.getElementsByTagName("script")[0];
       s.parentNode.insertBefore(hm, s);
       var cnzz_protocol = (("https:" == d.location.protocol) ? " https://" : " http://");
       d.write(unescape("%3Cspan id='cnzz_stat_icon_1267002346'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "s19.cnzz.com/z_stat.php%3Fid%3D1267002346%26show%3Dpic' type='text/javascript'%3E%3C/script%3E"));
+
+      // 百度推送
+      var bp = document.createElement('script');
+      var curProtocol = window.location.protocol.split(':')[0];
+      if (curProtocol === 'https') {
+        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
+      }
+      else {
+        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
+      }
+      var s = document.getElementsByTagName("script")[0];
+      s.parentNode.insertBefore(bp, s);
     })(window, document)
   </script>
   <script type="text/javascript">

+ 6 - 6
components/default/Footer.vue

@@ -5,17 +5,17 @@
         <div class="item">
           <h5>用户指南</h5>
           <ul class="list-unstyled">
-            <li><a href="http://www.usoftmall.com/help#/issue/50" target="_blank">服务条款</a></li>
-            <li><a href="http://www.usoftmall.com/help#/issue/16" target="_blank">买卖条例</a></li>
-            <li><a href="http://www.usoftmall.com/help#/issue/51" target="_blank">代收代付协议</a></li>
+            <li><a href="http://www.usoftmall.com/help/helpDetail/50" target="_blank">服务条款</a></li>
+            <li><a href="http://www.usoftmall.com/help/helpDetail/16" target="_blank">买卖条例</a></li>
+            <li><a href="http://www.usoftmall.com/help/helpDetail/51" target="_blank">代收代付协议</a></li>
           </ul>
         </div>
         <div class="item">
           <h5>关于我们</h5>
           <ul class="list-unstyled">
-            <li><a href="http://www.usoftmall.com/help#/issue/1" target="_blank">公司简介</a></li>
-            <li><a href="http://www.usoftmall.com/help#/issue/28" target="_blank">公司地址</a></li>
-            <li><a href="http://www.usoftmall.com/help#/issue/1" target="_blank">联系我们</a></li>
+            <li><a href="http://www.usoftmall.com/help/helpDetail/1" target="_blank">公司简介</a></li>
+            <li><a href="http://www.usoftmall.com/help/helpDetail/28" target="_blank">公司地址</a></li>
+            <li><a href="http://www.usoftmall.com/help/helpDetail/1" target="_blank">联系我们</a></li>
           </ul>
         </div>
         <div class="item">

+ 29 - 15
components/default/Header.vue

@@ -10,13 +10,15 @@
         </div>
         <div class="navbar-right">
           <template v-if="user.logged">
-            <div class="item-wrap dropdown">
+            <div class="item-wrap dropdown" @mouseleave="showEnterprises = false">
               <div class="item dropdown-toggle">
-                欢迎您,{{ user.data.userName }}&nbsp;<a @click="logout()">[退出]</a>
+                欢迎您,{{ user.data.userName }}&nbsp;|&nbsp;
+                <a @click="logout()">[退出]</a>
+                <span>{{enterprise.enName}}</span>
               </div>
               <ul class="dropdown-menu">
                 <li class="menu-item-first">
-                  <span class="member-text" :title="enterprise.enName"><i class="fa fa-map-marker"></i>&nbsp;{{ enterprise.enName }}</span>
+                  <span class="member-text" :title="enterprise.enName"><i class="fa fa-map-marker"></i>&nbsp;{{ enterprise.uu?enterprise.enName: user.data.userName + '(个人账户)' }}</span>
                   <a class="pull-right" @click="toggleEnterprises()" v-if="user.data.enterprises && user.data.enterprises.length > 0">
                     {{ showEnterprises ? '取消' : '切换' }}
                   </a>
@@ -66,9 +68,9 @@
       enterprise () {
         let ens = this.user.data.enterprises
         if (ens && ens.length) {
-          return ens.find(item => item.current) || {enName: this.user.data.userName + '个人账户'}
+          return ens.find(item => item.current) || {enName: '个人账户'}
         } else {
-          return {enName: this.user.data.userName + '个人账户'}
+          return {enName: '个人账户'}
         }
       },
       url () {
@@ -106,13 +108,14 @@
         this.toggleEnterprises()
         this.$http.get(`/user/authentication/${en.uu}`).then(() => {
           this.$store.dispatch('loadUserInfo')
-          let href = window.location.href
-          let hrefPath = href.slice(href.length - 14, href.length)
-          if (hrefPath === 'register-saler' && en.uu !== 0 && en.isVendor === 313) {
-            window.location.href = '/vendor#/index'
-          } else {
-            window.location.reload()
-          }
+//          let href = window.location.href
+//          let hrefPath = href.slice(href.length - 14, href.length)
+//          if (hrefPath === 'register-saler' && en.uu !== 0 && en.isVendor === 313) {
+//            window.location.href = '/vendor#/index'
+//          } else {
+//            window.location.reload()
+//          }
+          window.location.href = '/'
         })
       },
       toVendor: function () {
@@ -239,9 +242,20 @@
 
             .dropdown-toggle {
               line-height: $nav-height;
-
-              a:hover {
-                color: $red !important;
+              a {
+                margin-left: 15px;
+                float: right;
+                &:hover {
+                  color: $red !important;
+                }
+              }
+              span {
+                display: inline-block;
+                max-width: 190px;
+                overflow: hidden;
+                text-overflow: ellipsis;
+                white-space: nowrap;
+                float: right;
               }
             }
 

+ 11 - 11
components/home/Advert.vue

@@ -22,37 +22,37 @@
           spaceBetween: 20
         },
         adverts: [{
-          url: 'http://www.usoftmall.com/store/worldshine#/home',
+          url: 'http://www.usoftmall.com/store/worldshine',
           img: '/images/adverts/1.jpg'
         }, {
-          url: 'http://www.usoftmall.com/store/adtracon#/home',
+          url: 'http://www.usoftmall.com/store/adtracon',
           img: '/images/adverts/2.jpg'
         }, {
-          url: 'http://www.usoftmall.com/store/compa#/home',
+          url: 'http://www.usoftmall.com/store/compa',
           img: '/images/adverts/3.jpg'
         }, {
-          url: 'http://www.usoftmall.com/store/corestaff#/home',
+          url: 'http://www.usoftmall.com/store/corestaff',
           img: '/images/adverts/4.jpg'
         }, {
-          url: 'http://www.usoftmall.com/store/chipled#/home',
+          url: 'http://www.usoftmall.com/store/chipled',
           img: '/images/adverts/5.jpg'
         }, {
-          url: 'http://www.usoftmall.com/store/opd#/home',
+          url: 'http://www.usoftmall.com/store/opd',
           img: '/images/adverts/6.jpg'
         }, {
-          url: 'http://www.usoftmall.com/store/jrxy#/home',
+          url: 'http://www.usoftmall.com/store/jrxy',
           img: '/images/adverts/7.jpg'
         }, {
-          url: 'http://www.usoftmall.com/store/hbt#/home',
+          url: 'http://www.usoftmall.com/store/hbt',
           img: '/images/adverts/8.jpg'
         }, {
-          url: 'http://www.usoftmall.com/store/yjycoin#/home',
+          url: 'http://www.usoftmall.com/store/yjycoin',
           img: '/images/adverts/9.jpg'
         }, {
-          url: 'http://www.usoftmall.com/store/d3567635164a4811a5ba9e9adbcdcc87#/home',
+          url: 'http://www.usoftmall.com/store/d3567635164a4811a5ba9e9adbcdcc87',
           img: '/images/adverts/10.jpg'
         }, {
-          url: 'http://www.usoftmall.com/store/winsen#/home',
+          url: 'http://www.usoftmall.com/store/winsen',
           img: '/images/adverts/11.jpg'
         }]
       }

+ 25 - 3
components/main/Search.vue

@@ -18,9 +18,20 @@
     </div>
     <ul class="association" v-show="showAssociate && searchType == 'product'"
         @mouseenter="associate.focus=true" @mouseleave="associate.focus=false">
-      <li v-for="(k, index) in similarKeywords.data" :key="k" class="item"
+      <li v-if="similarKeywords.data.component && similarKeywords.data.component.length > 0" class="similar-title">型号:</li>
+      <li v-for="(k, index) in similarKeywords.data.component" :key="k.code" class="item"
           :class="{'active': index==associate.activeIndex}"
-          @click.stop.prevent="onAssociateClick(k)">{{ k }}
+          @click.stop.prevent="onAssociateClick(k.code)">{{ k.code }}
+      </li>
+      <li v-if="similarKeywords.data.brand && similarKeywords.data.brand.length > 0" class="similar-title">品牌:</li>
+      <li v-for="(k, index) in similarKeywords.data.brand" :key="k.nameCn" class="item"
+          :class="{'active': index==associate.activeIndex}"
+          @click.stop.prevent="onAssociateClick(k.nameCn)">{{ k.nameCn }}
+      </li>
+      <li v-if="similarKeywords.data.kind && similarKeywords.data.kind.length > 0" class="similar-title">类目:</li>
+      <li v-for="(k, index) in similarKeywords.data.kind" :key="k.nameCn" class="item"
+          :class="{'active': index==associate.activeIndex}"
+          @click.stop.prevent="onAssociateClick(k.nameCn)">{{ k.nameCn }}
       </li>
     </ul>
     <div class="search-hot">
@@ -53,7 +64,10 @@
         return this.$store.state.search.keywords
       },
       showAssociate () {
-        return this.keyword && this.associate.show && this.similarKeywords.data && this.similarKeywords.data.length
+        return this.keyword &&
+          this.associate.show &&
+          this.similarKeywords.data &&
+          (this.similarKeywords.data.brand || this.similarKeywords.data.component || this.similarKeywords.data.kind)
       }
     },
     props: {
@@ -224,6 +238,14 @@
           background-color: $grey-bg;
         }
       }
+      .similar-title {
+        padding: 0 15px;
+        line-height: 30px;
+        font-size: 16px;
+        font-weight: bold;
+        border-top: 1px solid #ccc;
+        cursor: default;
+      }
     }
   }
 </style>

+ 8 - 8
components/main/count/Box.vue

@@ -33,14 +33,14 @@
         return this.$store.state.product.common.counts
       }
     },
-    mounted () {
-      this.$nextTick(() => {
-        // 刷新统计信息
-        setInterval(() => {
-          this.loadCounts()
-        }, 30000)
-      })
-    },
+//    mounted () {
+//      this.$nextTick(() => {
+//        // 刷新统计信息
+//        setInterval(() => {
+//          this.loadCounts()
+//        }, 30000)
+//      })
+//    },
     methods: {
       loadCounts () {
         this.$store.dispatch('loadProductCounts', { _status: 'actived' })

+ 45 - 2
components/product/ComponentGoods.vue

@@ -100,8 +100,16 @@
         </td>
       </tr>
       <tr v-if="componentGoods.totalElements == 0">
-        <td colspan="10" class="text-center" style="line-height: 40px; font-size: 20px;">
-          <i class="fa fa-smile-o fa-lg"></i> 暂无产品信息
+        <td colspan="12">
+          <div class="empty">
+            <p class="empty-img">
+              <img src="/images/brandList/empty-cart.png">
+            </p>
+            <div class="empty-info">
+              <p class="grey"> 暂无产品信息 </p>
+              <a href="javascript:history.go(-1)"><i class="fa fa-mail-reply fa-xs"></i>返回上一页</a>
+            </div>
+          </div>
         </td>
       </tr>
       </tbody>
@@ -204,6 +212,41 @@
 </script>
 
 <style scoped>
+  /**/
+  .product-list tbody>tr .empty{
+    overflow: hidden;
+    margin: 0!important;
+    height:130px;
+    display:inline-flex;
+    align-items: center;
+  }
+  .product-list tbody>tr .empty .empty-img{
+    margin:0;
+    border:0;
+    min-width:143px;
+    min-height:72px;
+  }
+  .product-list tbody>tr .empty .empty-img img {
+    margin: 0;
+    border: 0;
+    min-width: 143px;
+    min-height: 72px;
+  }
+  .product-list tbody>tr .empty-info{
+    line-height: 14px;
+    width: 143px;
+  }
+  .product-list tbody>tr .grey{
+    color: #999;
+    font-size: 14px;
+  }
+  .product-list tbody>tr .empty .empty-info>a{
+    font-size: 14px;
+    color: #5078cb;
+  }
+  .product-list tbody>tr .empty .empty-info i{
+    margin-right:5px;
+  }
   .product-list{
     width: 1190px;
     margin-bottom: 20px;

+ 34 - 1
components/product/component/StoreInfo.vue

@@ -124,7 +124,17 @@
             </td>
           </tr>
           <tr v-if="!storeList.content || storeList.content.length == 0">
-            <td colspan="10" class="text-center" style="line-height: 40px; font-size: 14px;"><i class="fa fa-smile-o fa-lg"></i> 暂无现货</td>
+            <td colspan="12">
+              <div class="empty">
+                <p class="empty-img">
+                  <img src="/images/brandList/empty-cart.png">
+                </p>
+                <div class="empty-info">
+                  <p class="grey"> 暂无现货信息 </p>
+                  <a href="javascript:history.go(-1)"><i class="fa fa-mail-reply fa-xs"></i>返回上一页</a>
+                </div>
+              </div>
+            </td>
           </tr>
         </tbody>
       </table>
@@ -395,4 +405,27 @@
     text-align: left;
     color: #333;
   }
+  /**/
+  .storeInfo .empty{
+    overflow: hidden;
+    margin: 0!important;
+    height:130px;
+    display:inline-flex;
+    align-items: center;
+  }
+  .storeInfo .empty-info{
+    line-height: 14px;
+    width: 143px;
+  }
+  .empty-info .grey{
+    color: #999;
+    font-size: 14px;
+  }
+  .storeInfo .empty .empty-info>a{
+    font-size: 14px;
+    color: #5078cb;
+  }
+  .storeInfo .empty .empty-info i{
+    margin-right:5px;
+  }
 </style>

+ 2 - 2
components/register-saler/register/StepSecond.vue

@@ -38,11 +38,11 @@
     },
     watch: {
       chooseTag: function (val) {
-        this.getArticle(val === 1 ? 21 : 16)
+        this.getArticle(val === 1 ? 50 : 16)
       }
     },
     mounted () {
-      this.getArticle(21)
+      this.getArticle(50)
     },
     methods: {
       sectionChange: function (type) {

+ 45 - 2
components/search/GoodList.vue

@@ -137,8 +137,16 @@
             </td>
           </tr>
           <tr v-if="good_list.components.length == 'undefined' ||good_list.components.length == 0">
-            <td colspan="10" class="text-center" style="line-height: 40px; font-size: 20px;">
-              <i class="fa fa-smile-o fa-lg"></i> 暂无产品信息
+            <td colspan="12">
+              <div class="empty">
+                <p class="empty-img">
+                  <img src="/images/brandList/empty-cart.png">
+                </p>
+                <div class="empty-info">
+                  <p class="grey"> 暂无产品信息 </p>
+                  <a href="javascript:history.go(-1)"><i class="fa fa-mail-reply fa-xs"></i>返回上一页</a>
+                </div>
+              </div>
             </td>
           </tr>
           </tbody>
@@ -676,4 +684,39 @@
     color: #f39801;
   }
 
+/**/
+.product-list tbody>tr .empty{
+  overflow: hidden;
+  margin: 0!important;
+  height:130px;
+  display:inline-flex;
+  align-items: center;
+}
+.product-list tbody>tr .empty .empty-img{
+  margin:0;
+  border:0;
+  min-width:143px;
+  min-height:72px;
+}
+.product-list tbody>tr .empty .empty-img img {
+  margin: 0;
+  border: 0;
+  min-width: 143px;
+  min-height: 72px;
+}
+.product-list tbody>tr .empty-info{
+  line-height: 14px;
+  width: 143px;
+}
+.product-list tbody>tr .grey{
+  color: #999;
+  font-size: 14px;
+}
+.product-list tbody>tr .empty .empty-info>a{
+  font-size: 14px;
+  color: #5078cb;
+}
+.product-list tbody>tr .empty .empty-info i{
+  margin-right:5px;
+}
 </style>

+ 14 - 3
components/store/CommodityInfo.vue

@@ -37,7 +37,7 @@
               <span class="name">类&nbsp;目</span>:<span v-text="commodity.kindNameCn"></span>
             </div>
             <div class="com-info">
-              <span class="name">下&nbsp;载</span>:<a target="_blank" :href="component.attach">{{component.attach ? '规格书' : '暂无信息'}}</a>
+              <span class="name">下&nbsp;载</span>:<a @click="toAttach(component.attach)" v-if="component.attach">规格书</a><span v-if="!component.attach">暂无信息</span>
             </div>
             <div class="com-info">
               <span class="name">包&nbsp;装</span>:<span v-text="commodity.packaging || '无包装信息'"></span>
@@ -178,7 +178,7 @@ export default {
   },
   filters: {
     currency: function (num) {
-      if (typeof num === 'number') {
+      if (typeof num === 'number' && num > 0) {
         if (num <= 0.000001) {
           num = 0.000001
         } else {
@@ -216,7 +216,7 @@ export default {
     },
     calculate () {
       this.fragment.total = this.fragment.price * this.fragment.num
-      return Math.ceil(this.fragment.total * Math.pow(10, 2)) / Math.pow(10, 2)
+      return Math.ceil(this.fragment.total * Math.pow(10, 6)) / Math.pow(10, 6)
     },
     user () {
       return this.$store.state.option.user
@@ -456,6 +456,17 @@ export default {
         }
         return encryptStr
       }
+    },
+    toAttach: function (url) {
+      if (url === '1') {
+        this.$http.get('/login/page', {params: {returnUrl: window.location.href}}).then(response => {
+          if (response.data) {
+            window.location.href = response.data.content + '&baseUrl=' + encodeURIComponent(window.location.protocol + '//' + window.location.host + response.data.baseUrl)
+          }
+        })
+      } else {
+        window.open(url)
+      }
     }
   }
 }

+ 6 - 2
components/store/CommodityList.vue

@@ -107,7 +107,7 @@
                 </div>
                 <div class="col-xs-4 txt-info">
                   <p class="grey f16">暂无器件信息</p>
-                  <i class="iconfont">&#xe610;</i>&nbsp;<a href="/">返回首页</a>
+                  <a href="/">马上去逛一逛</a>
                 </div>
               </div>
             </td>
@@ -478,7 +478,7 @@ export default {
 		color: #fff;
 	}
 	.category-content{
-		min-height: 243px;
+		/*min-height: 243px;*/
 	}
 	.no-record{
 		font-size: 14px;
@@ -508,6 +508,10 @@ export default {
 	}
 	.text-center  .txt-info a{
 		font-size: 14px;
+    display: block;
+    color: #5078cb;
+    background: url('/images/all/icon_nianxian.jpg')no-repeat 105px center;
+    padding-left: 50px;
 	}
 	.text-center  .col-xs-4 i{
 		color: #5078cb;

+ 4 - 4
components/store/ComponentInfo.vue

@@ -5,14 +5,14 @@
         <span class="tab">产品参数<b class="tip">(仅供参考,以实际产品为准)</b></span>
       </div>
       <ul class="list-unstyled list-inline" style="margin-left: 0px;" v-if="component.properties">
-        <li v-for="property in component.properties" v-if="property.value">
+        <li v-for="property in component.properties">
           <div class="property-name">
             <span v-text="property.property.labelCn"></span>:
           </div>
-          <div class="property-value" v-text="property.value"></div>
+          <div class="property-value">{{property.value ? property.value : '-'}}</div>
         </li>
-        <li v-if="!component.properties || component.properties.length === 0" class="text-center">
-          <i class="fa fa-smile-o fa-lg"></i> 暂无参数信息
+        <li v-if="!component.properties || component.properties.length === 0" class="text-center" style="display:block;margin-top:0;">
+          暂无参数信息
         </li>
       </ul>
     </div>

+ 11 - 2
layouts/default.vue

@@ -1,6 +1,6 @@
 <template>
   <div id="app">
-    <header-view></header-view>
+    <header-view v-if="!isInFrame"></header-view>
     <nuxt/>
     <footer-view></footer-view>
     <right-bar></right-bar>
@@ -22,9 +22,18 @@
       }
     },
     computed: {
+      isInFrame () {
+        let cookies = this.$store.state.option.cookies
+        let cookieArr = cookies.split(';')
+        let cookieObj = {}
+        for (let i = 0; i < cookieArr.length; i++) {
+          let tmpArr = cookieArr[i].split('=')
+          cookieObj[tmpArr[0].trim()] = tmpArr[1].trim()
+        }
+        return cookieObj.type === 'erp'
+      },
       title () {
         let path = this.$route.path
-        console.log(path)
         if (path.startsWith('/help/helpList/')) {
           return this.helpTitle.item + '-优软商城'
         } else if (path.startsWith('/help/helpDetail')) {

+ 18 - 2
layouts/main.vue

@@ -1,6 +1,6 @@
 <template>
   <div id="main">
-    <header-view></header-view>
+    <header-view v-if="!isInFrame"></header-view>
     <main-header></main-header>
     <main-nav></main-nav>
     <nuxt/>
@@ -20,6 +20,11 @@
       MainHeader,
       MainNav
     },
+//    data () {
+//      return {
+//        isInFrame: false
+//      }
+//    },
     head () {
       return {
         title: this.title,
@@ -30,9 +35,20 @@
       }
     },
     computed: {
+      isInFrame () {
+        let cookies = this.$store.state.option.cookies
+        let cookieArr = cookies.split(';')
+        let cookieObj = {}
+        for (let i = 0; i < cookieArr.length; i++) {
+          let tmpArr = cookieArr[i].split('=') || []
+          if (tmpArr.length === 2) {
+            cookieObj[tmpArr[0].trim()] = tmpArr[1].trim()
+          }
+        }
+        return cookieObj.type === 'erp' || this.$route.query.type === 'erp'
+      },
       title () {
         let path = this.$route.path
-        console.log(path)
         if (path === '/product/kind/home') {
           return '电子元器件器件选型参数型号查询器件类别分类大全-优软商城'
         } else if (path.startsWith('/product/kind/')) {

+ 11 - 1
layouts/shop.vue

@@ -1,6 +1,6 @@
 <template>
   <div id="main">
-    <header-view></header-view>
+    <header-view v-if="!isInFrame"></header-view>
     <store-header/>
     <store-title/>
     <nuxt/>
@@ -34,6 +34,16 @@
       }
     },
     computed: {
+      isInFrame () {
+        let cookies = this.$store.state.option.cookies
+        let cookieArr = cookies.split(';')
+        let cookieObj = {}
+        for (let i = 0; i < cookieArr.length; i++) {
+          let tmpArr = cookieArr[i].split('=')
+          cookieObj[tmpArr[0].trim()] = tmpArr[1].trim()
+        }
+        return cookieObj.type === 'erp'
+      },
       title () {
         let path = this.$route.path
         if (path.startsWith('/store/') && getCount(path, '/') === 2) {

+ 2 - 8
middleware/authenticated.js

@@ -1,13 +1,7 @@
-
-export default function ({ isServer, store, req, redirect }) {
+export default function ({ isServer, store, req, redirect, route }) {
   // If nuxt generate, pass this middleware
   if (isServer && !req) return
-
   if (!store.state.option.user.logged) {
-    this.$http.get('/logout/crossBefore').then(response => {
-      if (response.data) {
-        window.location.href = response.data.logoutUrl + encodeURIComponent(window.location.protocol + '//' + window.location.host + response.data.baseUrl)
-      }
-    })
+    return redirect('/auth/login')
   }
 }

+ 15 - 0
pages/auth/login.vue

@@ -0,0 +1,15 @@
+<template>
+
+</template>
+<script>
+  export default {
+    layout: 'login',
+    mounted () {
+      this.$http.get('/login/page', {params: {returnUrl: window.location.protocol + '//' + window.location.host}}).then(response => {
+        if (response.data) {
+          window.location.href = response.data.content + '&baseUrl=' + encodeURIComponent(window.location.protocol + '//' + window.location.host + response.data.baseUrl)
+        }
+      })
+    }
+  }
+</script>

+ 15 - 0
pages/register-saler/index.vue

@@ -10,10 +10,25 @@
   import { RegHeader, Register } from '~components/register-saler'
   export default {
     name: 'index',
+    middleware: 'authenticated',
     components: {
       RegHeader,
       Register
+    },
+    computed: {
+      user () {
+        return this.$store.state.option.user
+      }
     }
+//    mounted () {
+//      if (!this.user.logged) {
+//        this.$http.get('/login/page', {params: {returnUrl: window.location.href}}).then(response => {
+//          if (response.data) {
+//            window.location.href = response.data.content + '&baseUrl=' + encodeURIComponent(window.location.protocol + '//' + window.location.host + response.data.baseUrl)
+//          }
+//        })
+//      }
+//    }
   }
 </script>
 <style>

+ 3 - 0
server.js

@@ -21,6 +21,9 @@ if (proxyTable) {
     res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE')
     res.header('Access-Control-Allow-Headers', 'Content-Type')
     res.header('Access-Control-Allow-Credentials', 'true')
+    if (res.req.headers.referer && res.req.headers.referer.substring(res.req.headers.referer.length - 9, res.req.headers.referer.length) === '?type=erp') {
+      res.cookie('type', 'erp')
+    }
     next()
   })
   if (Array.isArray(proxyTable)) {

BIN
static/images/all/icon_nianxian.jpg


+ 5 - 0
store/userType.js

@@ -0,0 +1,5 @@
+export const actions = {
+  setUserType ({ commit }, params = {}) {
+    commit('type/GET_TYPE_SUCCESS', params.type)
+  }
+}

+ 13 - 0
store/userType/type.js

@@ -0,0 +1,13 @@
+export const state = () => ({
+  type: {
+    fetching: false,
+    data: 'mall'
+  }
+})
+
+export const mutations = {
+  GET_TYPE_SUCCESS (state, result) {
+    state.type.fetching = false
+    state.type.data = result
+  }
+}