Browse Source

Merge remote-tracking branch 'origin/master'

suntg 7 years ago
parent
commit
6c07000747
2 changed files with 7 additions and 3 deletions
  1. 1 1
      components/applyPurchase/BatchPublish.vue
  2. 6 2
      plugins/axios.js

+ 1 - 1
components/applyPurchase/BatchPublish.vue

@@ -79,7 +79,7 @@
         <tr class="spot-goods" v-if="item.showSpotGoods">
           <td colspan="8">
             <div class="spot-goods-body">
-              <div class="spot-goods-title">商城现货(998)</div>
+              <div class="spot-goods-title">商城现货({{spotGoodsData.length || 0}})</div>
               <table>
                 <thead>
                 <tr>

+ 6 - 2
plugins/axios.js

@@ -7,9 +7,10 @@ const service = axios.create({
   baseURL: '/'
 })
 
+const isServer = typeof window === 'undefined'
 service.interceptors.request.use(config => {
   // is server render, use ${baseUrl} directly rather than ${proxyUrl}
-  if (typeof window === 'undefined') {
+  if (isServer) {
     if (config.url.indexOf('/inquiry') === 0) {
       config.url = process.env.commonUrl + config.url
     } else {
@@ -39,11 +40,14 @@ service.interceptors.response.use(response => {
       }
     }
   }
-  if (typeof window !== 'undefined') {
+  if (!isServer) {
     document.getElementById('loading').setAttribute('class', 'loading')
   }
   return response
 }, error => {
+  if (!isServer) {
+    document.getElementById('loading').setAttribute('class', 'loading')
+  }
   return Promise.reject(error)
 })