File tree Expand file tree Collapse file tree 13 files changed +36
-36
lines changed Expand file tree Collapse file tree 13 files changed +36
-36
lines changed Original file line number Diff line number Diff line change @@ -27,11 +27,11 @@ export default {
27
27
},
28
28
methods: {
29
29
... mapMutations ([
30
- ' updateTopbarBlock '
30
+ ' UPDATE_TOPBAR_BLOCK '
31
31
]),
32
32
navItemClick (item ) {
33
33
if (this .paramsAlias != item .alias ) {
34
- this .isTopbarBlock === false && this .updateTopbarBlock (true )
34
+ this .isTopbarBlock === false && this .UPDATE_TOPBAR_BLOCK (true )
35
35
window .scrollTo ({ top: 0 })
36
36
if (item .alias ) {
37
37
this .$router .push ({
Original file line number Diff line number Diff line change @@ -27,11 +27,11 @@ export default {
27
27
},
28
28
methods: {
29
29
... mapMutations ([
30
- ' updateTopbarBlock '
30
+ ' UPDATE_TOPBAR_BLOCK '
31
31
]),
32
32
navItemClick (item ) {
33
33
if (this .paramsName != item .name ) {
34
- this .isTopbarBlock === false && this .updateTopbarBlock (true )
34
+ this .isTopbarBlock === false && this .UPDATE_TOPBAR_BLOCK (true )
35
35
window .scrollTo ({ top: 0 })
36
36
this .$router .push ({
37
37
name: ' recommendation-authors-name' ,
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ export default {
31
31
},
32
32
methods: {
33
33
... mapMutations ([
34
- ' updateTopbarBlock '
34
+ ' UPDATE_TOPBAR_BLOCK '
35
35
]),
36
36
async getTagByCategories (categoryId ) {
37
37
await this .$api .getTagByCategories ({
@@ -41,7 +41,7 @@ export default {
41
41
},
42
42
navItemClick (item ) {
43
43
if (this .paramsTitle != item .title ) {
44
- this .isTopbarBlock === false && this .updateTopbarBlock (true )
44
+ this .isTopbarBlock === false && this .UPDATE_TOPBAR_BLOCK (true )
45
45
window .scrollTo ({ top: 0 })
46
46
this .$router .push ({
47
47
name: ' timeline-title' ,
Original file line number Diff line number Diff line change @@ -10,14 +10,14 @@ import { mapMutations } from 'vuex'
10
10
export default {
11
11
methods: {
12
12
... mapMutations ([
13
- ' updateTopbarBlock '
13
+ ' UPDATE_TOPBAR_BLOCK '
14
14
]),
15
15
backTop () {
16
16
window .scrollTo ({
17
17
top: 0
18
18
})
19
19
// 解决置顶后导航栏不显示
20
- this .updateTopbarBlock (true )
20
+ this .UPDATE_TOPBAR_BLOCK (true )
21
21
}
22
22
}
23
23
}
Original file line number Diff line number Diff line change @@ -80,13 +80,13 @@ export default {
80
80
let scrollTop = 0
81
81
window .addEventListener (' scroll' , () => {
82
82
if (scrollingElement .scrollTop < 300 ) {
83
- this .isTopbarBlock === false && this .updateTopbarBlock (true )
83
+ this .isTopbarBlock === false && this .UPDATE_TOPBAR_BLOCK (true )
84
84
return
85
85
}
86
86
if (scrollingElement .scrollTop > scrollTop) {
87
- this .updateTopbarBlock (false )
87
+ this .UPDATE_TOPBAR_BLOCK (false )
88
88
} else if (scrollingElement .scrollTop < scrollTop) {
89
- this .updateTopbarBlock (true )
89
+ this .UPDATE_TOPBAR_BLOCK (true )
90
90
}
91
91
scrollTop = scrollingElement .scrollTop
92
92
})
@@ -112,15 +112,15 @@ export default {
112
112
this .$api .setUserNotificationNum ()
113
113
this .getUserNotificationNum ()
114
114
}
115
- this .updateTopbarBlock (true )
115
+ this .UPDATE_TOPBAR_BLOCK (true )
116
116
}
117
117
},
118
118
immediate: true
119
119
}
120
120
},
121
121
methods: {
122
122
... mapMutations ([
123
- ' updateTopbarBlock '
123
+ ' UPDATE_TOPBAR_BLOCK '
124
124
]),
125
125
sreachHandler () {
126
126
this .$router .push ({
Original file line number Diff line number Diff line change @@ -10,10 +10,10 @@ export default function (context) {
10
10
} else { // 未过期 重新设置存储
11
11
const stateToken = store . state . auth . token
12
12
if ( cookiesToken && stateToken === '' ) {
13
- store . commit ( 'auth/updateUserInfo ' , app . $cookies . get ( 'userInfo' ) )
14
- store . commit ( 'auth/updateUserId ' , app . $cookies . get ( 'userId' ) )
15
- store . commit ( 'auth/updateClientId ' , app . $cookies . get ( 'clientId' ) )
16
- store . commit ( 'auth/updateToken ' , app . $cookies . get ( 'token' ) )
13
+ store . commit ( 'auth/UPDATE_USERINFO ' , app . $cookies . get ( 'userInfo' ) )
14
+ store . commit ( 'auth/UPDATE_USERID ' , app . $cookies . get ( 'userId' ) )
15
+ store . commit ( 'auth/UPDATE_CLIENTID ' , app . $cookies . get ( 'clientId' ) )
16
+ store . commit ( 'auth/UPDATE_TOKEN ' , app . $cookies . get ( 'token' ) )
17
17
}
18
18
}
19
19
}
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ export default {
38
38
} else {
39
39
bookCategoryList = await app .$api .getBookChannel ()
40
40
.then (res => res .s === 1 ? initBookCategoryList .concat (res .d ) : initBookCategoryList)
41
- store .commit (' category/updateBookCategoryList ' , bookCategoryList)
41
+ store .commit (' category/UPDATE_BOOK_CATEGORY_LIST ' , bookCategoryList)
42
42
}
43
43
return params .alias === undefined || bookCategoryList .includes (params .alias )
44
44
},
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ export default {
21
21
categoryList = store .state .category .recommendCategoryList
22
22
} else {
23
23
categoryList = await app .$api .getAuthorChannel ().then (res => res .s === 1 ? res .d : [])
24
- store .commit (' category/updateRecommendCategoryList ' , categoryList)
24
+ store .commit (' category/UPDATE_RECOMMEND_CATEGORY_LIST ' , categoryList)
25
25
}
26
26
// 作者榜单
27
27
let res = await app .$api .getAuthorRank ({
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ export default {
71
71
categoryList = store .state .category .timelineCategoryList
72
72
} else {
73
73
categoryList = await app .$api .getCategories ().then (res => res .s === 1 ? initCategoryList .concat (res .d .categoryList ) : initCategoryList)
74
- store .commit (' category/updateTimelineCategoryList ' , categoryList)
74
+ store .commit (' category/UPDATE_TIMELINE_CATEGORY_LIST ' , categoryList)
75
75
}
76
76
return params .title === undefined || categoryList .filter (item => item .title === params .title ).length
77
77
},
Original file line number Diff line number Diff line change @@ -7,16 +7,16 @@ export const state = () => ({
7
7
} )
8
8
9
9
export const mutations = {
10
- updateUserInfo ( state , payload ) {
10
+ UPDATE_USERINFO ( state , payload ) {
11
11
state . userInfo = payload
12
12
} ,
13
- updateUserId ( state , payload ) {
13
+ UPDATE_USERID ( state , payload ) {
14
14
state . userId = payload
15
15
} ,
16
- updateClientId ( state , payload ) {
16
+ UPDATE_CLIENTID ( state , payload ) {
17
17
state . clientId = payload
18
18
} ,
19
- updateToken ( state , payload ) {
19
+ UPDATE_TOKEN ( state , payload ) {
20
20
state . token = payload
21
21
}
22
22
}
You can’t perform that action at this time.
0 commit comments