Commit 3028447c by zhanghaozhe

Merge branch 'intelligent-recommend' into dev

parents 165e9abd 95f355c3
......@@ -29,7 +29,7 @@ class App extends Component {
super(props)
this.state = {
isShowActivityEntry: 0,
isShowChannel: 0
isShowChannel: 0,
}
this.globalEntry = null
}
......@@ -69,8 +69,8 @@ class App extends Component {
this.getUser()
this.utm()
const {history} = this.props
const {history, location} = this.props
this.records.push(location)
this.setNavigationRecord(this.props.location, this.props.history.action)
this.setPreviousLocation()
......@@ -95,9 +95,9 @@ class App extends Component {
from: {
pathname: this.previousLocation.pathname,
search: this.previousLocation.search,
hash: this.previousLocation.hash
}
}
hash: this.previousLocation.hash,
},
},
}
} else {
this.removeShareCodeCookie()
......@@ -114,7 +114,7 @@ class App extends Component {
// treasure_stage,宝箱阶段,0-不在活动时间,1-活动时间内
this.setState({
isShowActivityEntry: data.treasure_stage,
isShowChannel: data.is_show_site_window_by_channel
isShowChannel: data.is_show_site_window_by_channel,
}, () => {
data.treasure_stage && this.bindGlobalEntry()
})
......@@ -171,7 +171,7 @@ class App extends Component {
if (zhihu_cb) {
let data = {
'zhihu_cb': zhihu_cb
'zhihu_cb': zhihu_cb,
}
http.post(`${API['home']}/sys/zhihu/firstRecord`, data)
......@@ -253,8 +253,8 @@ class App extends Component {
user_name: username,
is_vip: isVIP,
uid,
code
}
code,
},
} = res.data
payload = {
......@@ -265,15 +265,15 @@ class App extends Component {
isVIP,
avatar,
uid,
code
}
code,
},
}
} else {
payload = {
hasError: true,
msg: res.data.msg,
code: res.data.code,
data: {}
data: {},
}
}
return payload
......@@ -284,7 +284,7 @@ class App extends Component {
if (data.errno == 200) {
//移除红包统计cookie
this.removeShareCodeCookie()
let {uid, token, avatar_file: avatar, uname: username,} = data.data
let {uid, token, avatar_file: avatar, uname: username} = data.data
return {
hasError: false,
......@@ -292,9 +292,9 @@ class App extends Component {
uid,
token,
avatar,
username
username,
},
msg: data.msg
msg: data.msg,
}
} else {
let {code, msg} = data.data
......@@ -302,7 +302,7 @@ class App extends Component {
code,
msg,
hasError: true,
data: {}
data: {},
}
}
}
......@@ -338,7 +338,7 @@ class App extends Component {
closeGlobalEntry = () => {
localStorage.setItem('globalEntryClosedTime', Date.now().toString())
this.setState({
isShowActivityEntry: 0
isShowActivityEntry: 0,
})
}
......@@ -377,7 +377,7 @@ class App extends Component {
export default compose(
connect(
state => ({user: state.user}),
{setCurrentUser, startFetchUser}
{setCurrentUser, startFetchUser},
),
withRouter
withRouter,
)(App)
......@@ -31,11 +31,12 @@ class IntelligentRecommend extends Component {
}
componentDidMount() {
const {user, intelligentRecommend, history} = this.props
const {user, intelligentRecommend, history, reselect} = this.props
if (user.hasError) {
return history.push('/passport')
}
if (!intelligentRecommend.processing.length) {
if (isEmpty(intelligentRecommend.result)) {
reselect()
this.getMessage()
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment