Browse Source

Merge remote-tracking branch 'origin/master'

suntg 8 năm trước cách đây
mục cha
commit
6c07000747

+ 1 - 1
components/applyPurchase/BatchPublish.vue

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

+ 6 - 2
plugins/axios.js

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