Skip to content
This repository was archived by the owner on Dec 2, 2019. It is now read-only.

Commit 2a8304f

Browse files
committed
fix channel
1 parent 2309f16 commit 2a8304f

3 files changed

Lines changed: 15 additions & 16 deletions

File tree

‎app/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "douban.fm",
33
"productName": "douban.fm",
4-
"version": "1.0.1",
4+
"version": "1.0.2",
55
"description": "豆瓣fm的桌面应用",
66
"main": "./main.js",
77
"author": "xwartz ",

‎dev.png‎

333 KB
Loading

‎src/actions/index.js‎

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ const receiveNever = () => {
2424
return { type: types.RECEIVE_NEVER }
2525
}
2626

27-
export const postNever = (channelId, sid) => {
27+
export const postNever = (channel, sid) => {
2828
return (dispatch) => {
2929
dispatch(never())
3030

31-
return operate('never_play_again', { channel_id: channelId, sid },
31+
return operate('never_play_again', { channel, sid },
3232
() => receiveNever())
3333
}
3434
}
@@ -38,30 +38,30 @@ const receiveLike = () => {
3838
return { type: types.RECEIVE_LIKE }
3939
}
4040

41-
export const postLike = (isLike, channelId, sid) => {
41+
export const postLike = (isLike, channel, sid) => {
4242
const method = isLike ? 'unstar' : 'star'
4343
return (dispatch) => {
4444
dispatch(like())
4545

46-
return operate(method, { channel_id: channelId, sid },
46+
return operate(method, { channel, sid },
4747
() => receiveLike())
4848
}
4949
}
5050

5151
// fetch more
52-
const requestMoreSongs = (channelId, sid) => {
53-
return { type: types.REQUEST_MORE, channel_id: channelId, sid }
52+
const requestMoreSongs = (channel, sid) => {
53+
return { type: types.REQUEST_MORE, channel, sid }
5454
}
5555

5656
const receiveMoreSongs = (songs) => {
5757
return { type: types.RECEIVE_MORE, songs }
5858
}
5959

60-
export const fetchMoreSongs = (channelId, sid, cb) => {
60+
export const fetchMoreSongs = (channel, sid, cb) => {
6161
return (dispatch) => {
62-
dispatch(requestMoreSongs(channelId, sid))
62+
dispatch(requestMoreSongs(channel, sid))
6363

64-
return operate('songs', { channel_id: channelId, sid },
64+
return operate('songs', { channel, sid },
6565
(songs) => {
6666
dispatch(receiveMoreSongs(songs))
6767
cb && cb()
@@ -70,19 +70,19 @@ export const fetchMoreSongs = (channelId, sid, cb) => {
7070
}
7171

7272
// fetch songs
73-
const requestSongs = (channelId) => {
74-
return { type: types.REQUEST_SONGS, channelId }
73+
const requestSongs = (channel) => {
74+
return { type: types.REQUEST_SONGS, channel }
7575
}
7676

7777
const receiveSongs = (songs) => {
7878
return { type: types.RECEIVE_SONGS, songs }
7979
}
8080

81-
export const fetchSongs = (channelId) => {
81+
export const fetchSongs = (channel) => {
8282
return (dispatch) => {
83-
dispatch(requestSongs(channelId))
83+
dispatch(requestSongs(channel))
8484

85-
return operate('songs', { channel_id: channelId },
85+
return operate('songs', { channel },
8686
(songs) => dispatch(receiveSongs(songs)))
8787
}
8888
}
@@ -133,7 +133,6 @@ export const login = (opt) => {
133133
return (dispatch) => {
134134
dispatch(requestLogin())
135135
return operate('login', opt, (data) => {
136-
console.log(data)
137136
if (data.body.r === 0) {
138137
dispatch(receiveLogin(data.body.user_info))
139138
dispatch(loginPop())

0 commit comments

Comments
 (0)