Skip to content

Commit b65d277

Browse files
committed
修改部分vuex数据
1 parent bddda73 commit b65d277

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

src/store/index.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,17 @@ export default new Vuex.Store({
1414
...instanceStates,
1515
...userStates,
1616
visibleDialogName: '', // 全局显示的 dialog name
17+
hasNewFeatures: false // 是否提示用户有新的特性
1718
},
1819
mutations: {
1920
...instanceMutations,
2021
...userMutations,
2122
setVisibleDialogName (state, newName) {
2223
state.visibleDialogName = newName
2324
},
25+
setHasNewFeatures (state, has) {
26+
state.hasNewFeatures = has
27+
}
2428
},
2529
actions: {
2630
},
@@ -36,8 +40,12 @@ export default new Vuex.Store({
3640
},
3741
isSelfProfile (state) {
3842
// 判断当前访问的是否为自己的主页
39-
const { loginState, loginInfo, curUserDetail } = state
40-
return loginState && loginInfo.username === curUserDetail.username
43+
const { loginState, loginInfo: { username }, curUserDetail: { username: curUsername } } = state
44+
return loginState && username === curUsername
45+
},
46+
isSelfInstance (state) {
47+
const { loginState, loginInfo: { username }, curInstanceDetail: { username: curUsername } } = state
48+
return loginState && username === curUsername
4149
}
4250
}
4351
})

src/store/mutations/user.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ const user = {
2020
detail[key] = ''
2121
}
2222
state.curUserDetail = Object.assign({}, detail)
23+
},
24+
setFollowState: (state, isFollow) => {
25+
state.curUserDetail.isMyFollow = isFollow
2326
}
2427
}
2528

0 commit comments

Comments
 (0)