25 lines
527 B
25 lines
527 B
import { listMessage } from '@/api/indexpage/newslist/newslist.js';
|
|
import { getuserId } from '@/utils/auth'
|
|
const mine = {
|
|
state: {
|
|
xiaoxi: 0
|
|
},
|
|
|
|
mutations: {
|
|
setXiaoXi: (state, py) => {
|
|
state.xiaoxi = py
|
|
},
|
|
},
|
|
actions: {
|
|
//我的消息--获取消息条数
|
|
getNewsListOne({ commit }) {
|
|
listMessage({ readStatus: '0', pageNum: 1, pageSize: 1, consumerId: getuserId() })
|
|
.then(res1 => {
|
|
//把消息数量存到vuex中去
|
|
commit('setXiaoXi', res1.total);
|
|
});
|
|
},
|
|
},
|
|
}
|
|
|
|
export default mine |