Skip to content
This repository has been archived by the owner on Nov 15, 2018. It is now read-only.

Commit

Permalink
fix(广告): 简化广告位 store 内容,不缓存广告列表
Browse files Browse the repository at this point in the history
  • Loading branch information
mutoe committed Jul 12, 2018
1 parent ae86b2e commit 140a927
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/stores/getters.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ export default {
* @returns {Object}
*/
getAdTypeBySpace: ({ ADVERTISEMENT }) => type => {
return ADVERTISEMENT.type.filter(ad => ad.space === type).pop() || {};
return ADVERTISEMENT.filter(ad => ad.space === type).pop() || {};
}
};
3 changes: 2 additions & 1 deletion src/stores/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ const state = {

CONFIG: lstore.getData("BOOTSTRAPPERS") || {},

ADVERTISEMENT: lstore.getData("ADVERTISEMENT") || { type: [], list: [] },
/* 广告位信息 */
ADVERTISEMENT: lstore.getData("ADVERTISEMENT") || [],

/* 终端信息 */
BROWSER: detectOS(),
Expand Down
4 changes: 2 additions & 2 deletions src/stores/mutations.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ export default {
* @author mutoe <[email protected]>
*/
ADVERTISEMENT(state, payload) {
state.ADVERTISEMENT = Object.assign(state.advertisement || {}, payload);
lstore.setData("ADVERTISEMENT", state.advertisement);
state.ADVERTISEMENT = payload;
lstore.setData("ADVERTISEMENT", state.ADVERTISEMENT);
},

/**
Expand Down

0 comments on commit 140a927

Please sign in to comment.