Authored by 李奇

fixed:get请求添加304强制不缓存

... ... @@ -18,7 +18,7 @@
<div class="resources">
<component
:is="component.template_name"
v-for="(component, index) in channel.home.filter(c => ['twoPicture', 'tfGoodsList', 'newSingleImage', 'BlkNewProductFloorResource'].some(k => k === c.template_name) )"
v-for="(component, index) in (channel.home || []).filter(c => ['twoPicture', 'tfGoodsList', 'newSingleImage', 'BlkNewProductFloorResource'].some(k => k === c.template_name) )"
:value="component.data"
:key="index"></component>
</div>
... ...
... ... @@ -97,17 +97,20 @@ export function createChannel() {
commit(FETCH_HOME_REQUEST);
try {
const getContent = this.$api.get('/api/resource/get', {content_code: HOME_CONTENT_CODE});
const getSlider = this.$api.get('/api/resource/get', {content_code: SLIDER_CONTENT_CODE});
const getContent = this.$api.get('/api/resource/get', {
home_invalid_cache: Date.now(),
content_code: HOME_CONTENT_CODE
});
const getSlider = this.$api.get('/api/resource/get', {
home_invalid_cache: Date.now(),
content_code: SLIDER_CONTENT_CODE
});
let [result, slider] = await Promise.all([getContent, getSlider]);
commit(FETCH_HOME_SUCCESS, {result, slider});
return result;
} catch (e) {
console.error(e);
console.log('fail')
commit(FETCH_HOME_FAILURE);
}
},
... ... @@ -118,14 +121,14 @@ export function createChannel() {
commit(FETCH_CHANNEL_SUCCESS, {cache: true});
return Promise.resolve();
}
console.log('刷新')
try {
let getSort = this.$api.get('/sort/list', {
home_invalid_cache: Date.now(),
channel: gender
});
let getResource = this.$api.get('/api/resource/get', {
home_invalid_cache: Date.now(),
content_code: gender === 'men' ? CHANNEL_MAN_CONTENT_CODE : CHANNEL_WOMEN_CONTENT_CODE
});
... ...